Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
145 views
in Technique[技术] by (71.8m points)

html - Stack images vertically to the right next to a video

I've been trying to make a column of images on the right of a centered video, but every time I manage to stack them, the video moves down. My goal is to keep the video centered in the top of the image and have a column of 4 images aligned in the right. Heres how the HTML5 code is going and de CSS so far.

    <body style="background-color:#f7f5f7;">
     <h1 align="center" class="Title">
      Virgen Del Apocalipsis
     </h1>

    <div class="parent">
     <img src="front_fotosF1.JPG" height="166px" width="260px" style="float:right">
     <img src="front_fotosF2.JPG" height="166px" width="260px" style="float:right">
     <img src="front_fotosF3.JPG" height="166px" width="260px" style="float:right">
     <img src="front_fotosF4.JPG" height="166px" width="260px" style="float:right">
    </div>

    <video style="float:center" class="center" muted autoplay loop controls >
      <source src="virgengrande.mp4" type="video/mp4">
      <source src="virgengrande.ogg" type="video/ogg">
      Your browser does not support the video tag.
    </video>

  </body>

CSS code:

*{
  margin: 0;
  padding: 0;
}

.Title {
  align: center;
  font-family: fantasy;
  padding: 25px;
}

.center {
  margin-left: auto;
  margin-right: auto;
  display: block;
  padding-left: 0%;
}

@media only screen and (min-width: 768px) {
  .wrapper{
    width: 600px;
    margin: 0 auto;
  }

}

Below you can find the current state of the product, the 4 images on the top are the ones that need to be in a column at the right.

Current state image

question from:https://stackoverflow.com/questions/65848734/stack-images-vertically-to-the-right-next-to-a-video

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Try this:

    .parent {
      display:grid;
      grid-row: 1;
      grid-column:1;
      position: absolute;
      right:0;
    }

You might need to add some responsive to this but should work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...