The div "tags" cannot be positioned beneath the photo as it is automatically located alongside the image inside the div

Is there a way to place the "Tags" div beneath an image, creating a bar of tags below it? I've been struggling to position it properly without disrupting the flow of the page. Using absolute positioning is not an option as it would break the layout. Additionally, when I try to use Display:block; for the image, it doesn't occupy the whole top area of the div "pab".

html, body{
  margin:0px;
  padding:0px;
}

.text{
  font-family: "Bangers";
  font-size: 5vh;
  color:white;
}

body{
  background:#a89ed2;
}

#topbar{
  background:#483467;
  display:block;
  height:calc(10vh - 1vh);
  border-bottom: 1vh solid #ea5773;
}

#media{
  display:flex;
  flex-direction: row;
  height:9vh;
  padding: 0px 1vw
}

#cord img{
  width:8vh;
  height:auto;
  margin-top:.5vh;
  filter: invert(1);
}

#cord span{
  position:relative; 
  bottom:2vh;
}

#pab{
  display:inline-flex;
  height:50vh;
  width:40vw
}

#pab img{
  height:30vh;
  border:2px solid white;
}

#tags{
  width:40vw;
  height:20vw;
  margin-top:100%;
  margin-left:100%;
  
}
<!doctype html>
<html>
  <head>
    <link rel="stylesheet"
  href="https://fonts.googleapis.com/css?family=Bangers">
  </head>
  <body>
    <div id=topbar>
      <div id=media>
        <div id=cord><img src="https://cdn1.iconfinder.com/data/icons/logos-and-brands-3/512/91_Discord_logo_logos-512.png"><span class=text>Salt#7283</span></div>
      </div>
    </div>
    <div id=pab><img src="https://cdn.discordapp.com/attachments/741394397064855749/742603618481471539/Webp.net-resizeimage_39.png">
      <div id=tags></div>
    </div> 
  </body>
</html>

Answer №1

Do I need to mark all my CSS edits?

html, body{
  margin:0px;
  padding:0px;
}

.text{
  font-family: "Bangers";
  font-size: 5vh;
  color:white;
}

body{
  background:#a89ed2;
}

#topbar{
  background:#483467;
  display:block;
  height:calc(10vh - 1vh);
  border-bottom: 1vh solid #ea5773;
}

#media{
  display:flex;
  flex-direction: row;
  height:9vh;
  padding: 0px 1vw
}

#cord img{
  width:8vh;
  height:auto;
  margin-top:.5vh;
  filter: invert(1);
}

#cord span{
  position:relative; 
  bottom:2vh;
}

#pab{
  display: inline-flex; /*add*/
  flex-direction: column; /*add*/
  align-items: flex-start; /*add*/
  
  height:50vh;
  width:40vw
}

#pab img{
  height:30vh;
  border:2px solid white;
}

#tags{
  width:40vw;
  height:20vw;
  /*margin-top:100%;*/ /*remove*/
  /*margin-left:100%;*/ /*remove*/
  background-color: aquamarine; /*add*/
  
}
<!doctype html>
<html>
  <head>
    <link rel="stylesheet"
  href="https://fonts.googleapis.com/css?family=Bangers">
  </head>
  <body>
    <div id=topbar>
      <div id=media>
        <div id=cord><img src="https://cdn1.iconfinder.com/data/icons/logos-and-brands-3/512/91_Discord_logo_logos-512.png"><span class=text>Salt#7283</span></div>
      </div>
    </div>
    <div id=pab><img src="https://cdn.discordapp.com/attachments/741394397064855749/742603618481471539/Webp.net-resizeimage_39.png">
      <div id=tags></div>
    </div> 
  </body>
</html>

Answer №2

If you're looking for something similar to this design...

html, body{
  margin:0px;
  padding:0px;
}

.text{
  font-family: "Bangers";
  font-size: 5vh;
  color:white;
}

body{
  background:#a89ed2;
}

#topbar{
  background:#483467;
  display:block;
  height:calc(10vh - 1vh);
  border-bottom: 1vh solid #ea5773;
}

#media{
  display:flex;
  flex-direction: row;
  height:9vh;
  padding: 0px 1vw
}

#cord img{
  width:8vh;
  height:auto;
  margin-top:.5vh;
  filter: invert(1);
}

#cord span{
  position:relative; 
  bottom:2vh;
}

#pab{
  height:50vh;
}

#pab img{
  height:30vh;
  border:2px solid white;
}

#tags{

  
}
#wrapper{
 display: flex;
}
  <div id=topbar>
    <div id=media>
      <div id=cord><img src="https://cdn1.iconfinder.com/data/icons/logos-and-brands-3/512/91_Discord_logo_logos-512.png"><span class=text>Salt#7283</span></div>
    </div>
  </div>
  <div id="wrapper">
    <div id=pab>
      <img src="https://cdn.discordapp.com/attachments/741394397064855749/742603618481471539/Webp.net-resizeimage_39.png">
      <div id=tags>Tag Here</div>
    </div> 
    <div>
      Other Contents here
    </div>
  </div> 

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Challenges arise with CSS alignment when adding d3.js charts to a webpage

I'm puzzled by the empty space that appears between the left column (highlighted in the image) and the header. This peculiar gap only seems to occur when the middle column is filled with a chart. I've scrutinized the code using Chrome Developer t ...

"Utilize jQuery's append method to dynamically add elements to the DOM and ensure

I am currently facing an issue with my AJAX function that appends HTML to a page using the jQuery append method. The HTML being appended is quite large and contains cells with colors set by CSS within the same document. The problem I'm encountering i ...

Variations in functionality within the Google Chrome browser

This is the content of my HTML document. <BODY> <button id="b1" onclick="load()">Play</button> <canvas id="c1" onclick="f_clicked(this.id,1)"> Your browser does not support the HTML5 canvas tag. </canvas> ...

What is the best way to close an ajax page within the main page using a button?

I am dealing with a situation where I have 2 pages. The first page contains a div called 'ajaxicall', which loads another page inside it. The challenge I am facing is figuring out how to close the second page when I click on the "close" button w ...

Tips on getting your card to stay at the top

Screenshot of webpage HTML (EJS): In the HTML file, look for the section after <%- include("navbar.ejs") -%> inside the body tag. The ".cardholder" contains "anime-card" templates (card.ejs). The first and last div within ".cardholder" are ...

Ways to conceal a child div element without using any specific ID reference

I encountered an issue where I need to conceal all divs within a parent div except the first one. The challenge is that these divs do not possess any unique identifiers. Is there a way to achieve this task using CSS or pure JavaScript? <div role="list ...

What are some ways to slow down the speed of a canvas animation?

I am currently working on an animation project using JavaScript and canvas. I have a reference fiddle where objects are generated randomly and fall from the top right corner to the bottom left corner, which is fine. However, the issue is that the objects a ...

Press the Instagram Follow Buttons by utilizing Selenium with Java

click here for image description Hello, I am currently working on automating the process of clicking follow buttons using Java. However, I'm encountering difficulties when trying to use JavascriptExecutor within a for loop. Below is the code snippet ...

Ensure that the heading cells in the table header (thead) are properly

Struggling with aligning the thead with the td in the tbody? I attempted adjusting the thead using display: table-header-group;, but discovered that padding doesn't work on 'table-header-group'. This led me to try adding padding-left to my t ...

A table featuring an HTML select element that allows users to choose from preset options or manually enter

My goal is to incorporate a select box where users can either choose from a set list of options or input their own custom value. The select element is nested within a table. Unfortunately, using datalist is not a viable solution for me in this case. I have ...

Is there a way to customize the slicing of *ngFor in a component according to the components it is being injected into?

This code snippet represents a component that needs to be included in other components: <div class="row"> <div class="col-12 [...]" *ngFor="let course of courses"> <div class="card"> ...

Add a new element to the page with a smooth fade-in animation using jQuery

var content = "<div id='blah'>Hello stuff here</div>" $("#mycontent").append(content).fadeIn(999); Unfortunately, the desired effect is not achieved with this code. I am trying to create a sleek animation when adding new content. ...

Changing position of element upon appearance of span in React

Currently, I am working with React and facing an issue where a span element appears whenever a user hovers over a text element. The problem is that the existing text shifts leftwards when the span appears (to the right of the text). The desired behavior ...

placed three blocks inside the table cell

Is there a way to align three blocks in the table-cell layout so that p1 is at the top, p2 is at the bottom, and p3 is in the middle? Here is the corresponding HTML: <div id="table"> <div id="row"> <div id= ...

The data-toggle function is not functioning properly with the code provided

Could someone shed some light on why my tabs and navigation bar dropdown button are not functioning properly? <div class="col-12"> <h2>Corporate Leadership</h2> <ul class = "nav nav-tabs&q ...

The multiple lines text box displays an input box

Having a simple issue here, I've set the value of an input text box, but when the page loads it is displaying in multiple lines, and this seems to be happening only on Chrome browser. Can anyone offer any assistance? This is the HTML code for the ...

The Tailwind Typography plugin simply maintains the default font size of heading tags without altering their style

I've been working on parsing an MDX file and converting it into React components. My tech stack includes TailwindCSS, Next.js, and React. Following the Tailwind documentation, I have installed the tailwind/typography plugin. In my tailwind.config.js ...

Color the area entirely in black

I am currently working on a project for one of my courses, where I have created a website for a specific service. However, I am facing some challenges and things are not going as smoothly as I had hoped. Here is a screenshot of the page: https://i.stack.im ...

Execute a jQuery function every time the class of the parent container div changes

I am seeking to trigger the function below whenever its containing div parent <div class="section">...</div> transitions to an "active" state, for example: <div class="section active">...</div> $(".skills-grid__col").each(function ...

Stop Scrolling on Web Pages with HTML5

I need assistance in preventing all forms of page scrolling within my HTML5 application. Despite searching on popular platforms like SO and Google, I have been unable to find a comprehensive solution for disabling all scrolling mechanisms entirely. Existin ...