选取框与图像在同一行

Marquee on the same line with image

我想在 "Diversitati transparent" 上从右到左在图像的同一行上放置一个选取框(选取框的文本应该进入图像)。

我有这个代码:

h1 {
  text-shadow: 2px 2px #FF0000;
}

h2 {
  text-shadow: 2px 2px #FF0000;
}

.header img {
  float: left;
  width: 100px;
  height: 100px;
  background: #555;
}

.header h1 {
  position: relative;
  top: 18px;
  left: 140px;
}

.header h2 {
  position: relative;
  top: 18px;
  left: 500px;
}
<div class="header">
  <img src="sigla.jpg" alt="logo" />
  <body bgcolor="lightblue">
    <center>
      <h1>Diversitati transparente</h1>
    </center>
    <i><h2> Pagina de start </h2>
</div>

  1. 选取框已弃用
  2. 选取框占 100%,所以变窄
  3. 我修复了你的一些 html

body {
  background-color: lightblue
}

h1 {
  text-shadow: 2px 2px #FF0000;
}

h2 {
  text-shadow: 2px 2px #FF0000;
}

.header img {
  float: left;
  width: 100px;
  height: 100px;
  background: #555;
}

.header h1 {
  position: relative;
  top: 18px;
  left: 140px;
}

.header h2 {
  position: relative;
  top: 18px;
  left: 500px;
}
#imgcontainer { float:left }
marquee { width:80% } 
<div class="header">
  <div id="imgcontainer"><img src="https://via.placeholder.com/350x150" alt="logo" /></div>
  <marquee>
    <h1>Diversitati transparente</h1>
  </marquee>
  <h2> Pagina de start </h2>
</div>