When ever I re-size the window the header moves leaving a space on the right side. (Refer to image ). If I shrink the window horizontally even more the gap increases. I have only been able to fix this problem by making the position for header to fixed but then the text overlaps. I want the header to move with the vertical scroll. Any help on here where I am going wrong is highly appreciated.
*{
padding:0;
margin:0 auto;
font-family: 'Museo Slab 300';
}
html{
background: url("Images/backlines.png") no-repeat center center fixed;
}
.company-header {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%,color-stop(0, rgb(226, 226, 226)),color-stop(0, rgb(254, 254, 254)),color-stop(0.1, rgb(254, 254, 254)),color-stop(1, rgb(219, 219, 219)),color-stop(1, rgb(209, 209, 209)));
height: 140px;
box-shadow: 0px 2px;
position: absolute;
width: 100%;
top: 0px;
}
.company-footer{
position: fixed;
right: 0;
bottom: 0;
left: 0;
padding: 1rem;
background-color: #efefef;
text-align: left;
z-index:-1;
box-shadow: 0px -4px rgba(0, 173, 239, 1);
}
img#logo-image {
position: absolute;
left: 270px;
}
div#setting-dropdown {
position: relative;
float: right;
right: 250px;
top: 58px;
}
div#setting-dropdown-content {
display: none;
background: rgba(0, 173, 239, 1);
width: 196px;
margin-left: -70px;
padding: 4px 5px 5px 7px;
}
div#setting-dropdown-content a {
color: white;
text-decoration: none;
font-size: 16px;
font-family: 'Museo Slab 300';
display: inline-block;
}
div#setting-dropdown i {
display: inline-block;
padding: 5px;
padding-right: 7px;
text-align: center;
border-radius: 10px 10px 0 0;
padding-bottom: 10px;
color: rgba(0, 173, 239, 1);
}
div#setting-dropdown:hover i {
background-color: rgba(0, 173, 239, 1);
color:white;
}
#setting-dropdown:hover #setting-dropdown-content {
display:block;
}
p#setting-dropdown {
font-size: 20px;
font-weight: bold;
}
button#company-logout {
background: rgba(255, 255, 255, 1);
border: none;
border-radius: 40px 40px 40px 40px;
width: 135px;
height: 40px;
font-size: 19px;
font-weight: 900;
font-family: 'Museo Slab 700';
float: right;
top: 54px;
right: -40px;
position: relative;
}
div#log-in {
position: relative;
top: 200px;
}
div#welcome-text {
margin-left: 276px;
font-family: 'Museo Slab 300';
font-size: 22px;
}
div#loginHeader {
margin-top: 60px;
margin-left: 276px;
}
div#dropdown-main-content {
position: relative;
top: 230px;
left: 276px;
display: inline-flex;
}
.dropdown {
position: relative;
width: 11em;
top: 60px;
right: 260px;
}
.dropbtn {
color: white;
width: 100%;
height: 3.2em;
font-size: 16px;
border: none;
text-align: start;
font-weight: 900;
background: rgba(0, 173, 239, 1);
border-radius: 50px 50px 50px 50px;
-moz-border-radius: 0px;
z-index: 2;
text-indent: 23px;
}
.dropdown-content {
display: none;
z-index: -1;
background-color: #f9f9f9;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
margin-top: -64px;
width: 176px;
}
.dropdown a {
background:url("Images/sidearrow.png") no-repeat 7px;
}
.dropdown-content a {
color: black;
padding: .75em;
text-decoration: none;
display: block;
border: 1px solid #000;
border-top: none;
text-indent: 12px;
width: 150px;
}
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-color: #3e8e41;
}
.dropdown-content a:hover {
background:url("Images/sidewhite.png") no-repeat 3px;
background-color: rgb(255,131,0);
color:white;
font-weight:900;
}
.dropdown-content a:first-child {
padding-top: 35px;
background: url("Images/sidearrow.png") no-repeat 7px 36px;
}
.dropdown-content a:first-child:hover {
background: url("Images/sidewhite.png") no-repeat 3px 36px;
color:white;
background-color: rgb(255,131,0);
font-weight:900;
}
img#sphere {
position: relative;
width: 35px;
height: 34px ;
left: 133px;
bottom: 42px;
}
img#sphere-arrow {
position: relative;
bottom: 44px;
left: 99px;
}
div#login-form {
margin-top: 100px;
margin-left: 276px;
}
.page-label {
font-size: 19px;
}
button#loginSubmit {
margin-top: 75px;
background: rgba(0, 173, 239, 1);
border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 40px 40px 40px 40px;
width: 185px;
height: 60px;
font-size: 20px;
font-family: sans-serif;
color: white;
font-weight: 900;
border: none;
position: absolute;
margin-left: 278px;
}
div#login-landingpage{
margin-left: 276px;
margin-top: 90px;
}
select.security-questions {
width: 450px;
height: 40px;
font-weight: bold;
}
.security-question-labels {
font-size: 21px;
font-family: 'Museo Slab 300';
}
<!DOCTYPE html>
<html>
<head>
<title>Averios</title>
<link rel="stylesheet" type="text/css" href="test.css">
<link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" />
<meta charset="utf-8">
</head>
<body>
<div class="company-header">
<img id="averios-logo-image" src="Images/averioslogo.png" width="176" height="129">
<div id="setting-dropdown">
<!-- SETTING DROPDOWN WILL GO HERE -->
<p id="setting-dropdown"> SETTINGS <i class="ion-chevron-down"></i></p>
<div id="setting-dropdown-content">
Change Password
Change Security Settings
</div>
</div>
<button id="company-logout"> LOGOUT </button>
</div>
<div id="log-in">
<div id="loginHeader">
<h1>Portal</h1>
</div>
<br>
<br>
<div id="welcome-text">
<p> Welcome name </p>
<p> Your last login was time on date </p>
<br>
<p> Please select an application below to begin </p>
</div>
</div>
<div id="dropdown-main-content">
<img id="pulse-image" src="C:\Users\user\Desktop\Final-Designs\Images\pulse.png" width="320" height="50" alt=""/>
<div id="dropdown-one">
<div class="dropdown">
<button class="dropbtn">SELECT</button>
<img id="sphere" src="C:\Users\user\Desktop\Final-Designs\Images\sphere.png" alt=""/>
<img id="sphere-arrow" src="C:\Users\user\Desktop\Final-Designs\Images\arrow.png" alt=""/>
<div class="dropdown-content">
option0
option1
</div>
</div>
</div>
<!-- SENTINAL -->
<img id="sentinal-image" src="C:\Users\user\Desktop\Final-Designs\Images\sentinal.png" width="380" height="50" alt=""/>
<div id="dropdown-second">
<div class="dropdown">
<button class="dropbtn">SELECT</button>
<img id="sphere" src="C:\Users\user\Desktop\Final-Designs\Images\sphere.png" alt=""/>
<img id="sphere-arrow" src="C:\Users\user\Desktop\Final-Designs\Images\arrow.png" alt=""/>
<!--<div class="sphere-two">
<div id="arrow-two">
<img src="C:\Users\user\Desktop\Images\arrow.png" width="29" height="27" alt=""/>
</div>
</div>-->
<div class="dropdown-content">
option0
option1
</div>
</div>
</div>
</div>
<div class="company-footer">
<div id="footer-text">
© 2016 Company, All Rights Reserved.
</div>
</div>
</body>
</html>
Problem is
div#dropdown-main-content {
position: relative;
top: 230px;
left: 276px;
display: inline-flex; }
try to remove display to inline and left to 0 like this
div#dropdown-main-content {
position: relative;
top: 230px;
display: inline; }
also remove fixed widths from images and divs, try to use max-width.
update
*{
padding:0;
margin:0 auto;
font-family: 'Museo Slab 300';
}
html{
background: url("Images/backlines.png") no-repeat center center fixed;
}
.averios-header {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%,color-stop(0, rgb(226, 226, 226)),color-stop(0, rgb(254, 254, 254)),color-stop(0.1, rgb(254, 254, 254)),color-stop(1, rgb(219, 219, 219)),color-stop(1, rgb(209, 209, 209)));
height: 140px;
box-shadow: 0px 2px;
position: absolute;
width: 100%;
top: 0px;
}
.averios-footer{
position: fixed;
right: 0;
bottom: 0;
left: 0;
padding: 1rem;
background-color: #efefef;
text-align: left;
z-index:-1;
box-shadow: 0px -4px rgba(0, 173, 239, 1);
}
img#averios-logo-image {
position: absolute;
left: 270px;
}
div#setting-dropdown {
position: relative;
float: right;
right: 250px;
top: 58px;
}
div#setting-dropdown-content {
display: none;
background: rgba(0, 173, 239, 1);
width: 196px;
margin-left: -70px;
padding: 4px 5px 5px 7px;
}
div#setting-dropdown-content a {
color: white;
text-decoration: none;
font-size: 16px;
font-family: 'Museo Slab 300';
display: inline-block;
}
div#setting-dropdown i {
display: inline-block;
padding: 5px;
padding-right: 7px;
text-align: center;
border-radius: 10px 10px 0 0;
padding-bottom: 10px;
color: rgba(0, 173, 239, 1);
}
div#setting-dropdown:hover i {
background-color: rgba(0, 173, 239, 1);
color:white;
}
#setting-dropdown:hover #setting-dropdown-content {
display:block;
}
p#setting-dropdown {
font-size: 20px;
font-weight: bold;
}
button#averios-logout {
background: rgba(255, 255, 255, 1);
border: none;
border-radius: 40px 40px 40px 40px;
width: 135px;
height: 40px;
font-size: 19px;
font-weight: 900;
font-family: 'Museo Slab 700';
float: right;
top: 54px;
right: -40px;
position: relative;
}
div#log-in {
position: relative;
top: 200px;
}
div#welcome-text {
margin-left: 276px;
font-family: 'Museo Slab 300';
font-size: 22px;
}
div#loginHeader {
margin-top: 60px;
margin-left: 276px;
}
div#dropdown-main-content {
position: relative;
top: 230px;
display: inline-block;
text-align: center;
width: 100%;
}
.dropdown {
position: relative;
width: 11em;
top: 60px;
}
.dropbtn {
color: white;
width: 100%;
height: 3.2em;
font-size: 16px;
border: none;
text-align: start;
font-weight: 900;
background: rgba(0, 173, 239, 1);
border-radius: 50px 50px 50px 50px;
-moz-border-radius: 0px;
z-index: 2;
text-indent: 23px;
}
.dropdown-content {
display: none;
z-index: -1;
background-color: #f9f9f9;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
margin-top: -64px;
width: 176px;
}
.dropdown a {
background:url("Images/sidearrow.png") no-repeat 7px;
}
.dropdown-content a {
color: black;
padding: .75em;
text-decoration: none;
display: block;
border: 1px solid #000;
border-top: none;
text-indent: 12px;
width: 150px;
}
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-color: #3e8e41;
}
.dropdown-content a:hover {
background:url("Images/sidewhite.png") no-repeat 3px;
background-color: rgb(255,131,0);
color:white;
font-weight:900;
}
.dropdown-content a:first-child {
padding-top: 35px;
background: url("Images/sidearrow.png") no-repeat 7px 36px;
}
.dropdown-content a:first-child:hover {
background: url("Images/sidewhite.png") no-repeat 3px 36px;
color:white;
background-color: rgb(255,131,0);
font-weight:900;
}
img#sphere {
position: relative;
width: 35px;
height: 34px ;
left: 133px;
bottom: 42px;
}
img#sphere-arrow {
position: relative;
bottom: 44px;
left: 99px;
}
div#login-form {
margin-top: 100px;
margin-left: 276px;
}
.page-label {
font-size: 19px;
}
input[type="text"] {
background: #EDEDEE;
background : rgba(237, 237, 238, 1);
border-style : Solid;
border-color : #4B4E53;
border-color : rgba(75, 78, 83, 1);
border-width : 1px;
width: 370px;
height: 35px;
font-size: 26px;
}
input[type="password"] {
background: #EDEDEE;
background : rgba(237, 237, 238, 1);
border-style : Solid;
border-color : #4B4E53;
border-color : rgba(75, 78, 83, 1);
border-width : 1px;
width: 370px;
height: 35px;
font-size: 26px;
}
button#loginSubmit {
margin-top: 75px;
background: rgba(0, 173, 239, 1);
border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 40px 40px 40px 40px;
width: 185px;
height: 60px;
font-size: 20px;
font-family: sans-serif;
color: white;
font-weight: 900;
border: none;
position: absolute;
margin-left: 278px;
}
div#login-landingpage{
margin-left: 276px;
margin-top: 90px;
}
select.security-questions {
width: 450px;
height: 40px;
font-weight: bold;
}
.security-question-labels {
font-size: 21px;
font-family: 'Museo Slab 300';
}
button#saveSubmit {
margin-top: 55px;
background: rgba(0, 173, 239, 1);
border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 40px 40px 40px 40px;
width: 170px;
height: 55px;
font-size: 20px;
font-family: sans-serif;
color: white;
font-weight: 900;
border: none;
position: absolute;
margin-left: 278px;
}
button#cancelSubmit {
margin-top: 55px;
background: rgb(75,79,84);
border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 40px 40px 40px 40px;
width: 170px;
height: 55px;
font-size: 20px;
font-family: sans-serif;
color: white;
font-weight: 900;
border: none;
position: absolute;
margin-left: 478px;
}
div#security-form {
margin-top: 60px;
margin-left: 276px;
}
/* TEST */
div#dropdown-col-2 {
display:inline-block;
}
div#dropdown-second {
position: absolute;
left: 1040px;
top: -10px;
}
//HTML
<div class="averios-header">
<img id="averios-logo-image" src="http://lorempixel.com/176/129/"></img>
</a>
<div id="setting-dropdown">
<!-- SETTING DROPDOWN WILL GO HERE -->
<p id="setting-dropdown"> SETTINGS <i class="ion-chevron-down"></i></p>
<div id="setting-dropdown-content">
Change Password
Change Security Settings
</div>
</div>
<button id="averios-logout"> LOGOUT </button>
</div>
<div id="log-in">
<div id="loginHeader">
<h1> Portal</h1>
</div>
<br>
<br>
<div id="welcome-text">
<p> Welcome name </p>
<p> Your last login was time on date </p>
<br>
<p> Please select an application below to begin </p>
</div>
</div>
<div id="dropdown-main-content">
<div id="dropdown-col-2">
<img id="averios-pulse-image" src="http://lorempixel.com/362/46/" alt="" />
<div class="dropdown">
<button class="dropbtn">SELECT</button>
<div class="dropdown-content">
Option1
</div>
</div>
</div>
<!-- SENTINAL -->
<div id="dropdown-col-2">
<img id="averios-sentinal-image" src="http://lorempixel.com/362/46/" alt="" />
<div class="dropdown">
<button class="dropbtn">SELECT</button>
<div class="dropdown-content">
Option1
</div>
</div>
</div>
</div>
<div class="averios-footer">
<div id="footer-text">
© 2016, All Rights Reserved.
</div>
</div>
Related
I'm coding an area which is intended for posting on a forum, and therefore should expand with the content as it grows longer. I coded it with a min-height, and thought it would move with the rest as it expanded. Unfortunately, the posting area itself expands, but the areas/footers beneath it don't move down. They stay firmly in place.
I've searched all over, and saw mentions of floats and clearfixes, so I'm not sure if that's what I need to do. I attempted some clearfix methods, but they either malfunctioned or simply didn't work at all. I also tried adding 'overflow:hidden' to all of the sections with floats, but that did nothing. I'm also unfamiliar with coding with flexboxes right now, so that isn't a suitable solution for me at this time.
I think having some new sets of eyes on this would be very helpful. Please help me see where I'm going wrong.
Unfortunately, I don't have a codepen link for this one because I changed it significantly from its original model when I put it on my site. I can link to a thread where it's showing the issue though: https://lovedive.jcink.net/index.php?showtopic=5&st=0&#entry20
Here's the full code and css. It's long so hopefully that's not a pain.
.posting {
width: 1100px;
min-height: 1380px;
background-color: #f7f7f7;
border-radius: 15px 15px 10px 10px;
border: 1px solid #eee;
position: relative;
z-index: 0;
margin-bottom: 20px;
}
.proftop {
width: 1100px;
height: 150px;
padding: 0px;
background-image: linear-gradient( to bottom right, rgba(202, 186, 202, 0.2), rgba(123, 83, 123, 0.7));
/****CHANGE FOR GROUP****/
border-radius: 15px 15px 0px 0px;
overflow: hidden;
}
.proftopname {
width: 800px;
padding: 15px;
font-family: abril fatface;
font-size: 45px;
text-align: center;
color: #ffffff;
text-transform: lowercase;
text-shadow: 1px -1px 0px rgba(0, 0, 0, 0.2), -1px 1px 0px rgba(0, 0, 0, 0.2), 1px 1px 0px rgba(0, 0, 0, 0.2), -1px -1px 0px rgba(0, 0, 0, 0.2);
letter-spacing: 2px;
position: absolute;
left: 0px;
top: 30px;
}
.proftopname a {
color: #ffffff;
}
.proftoppic {
position: absolute;
top: 0px;
right: 0px;
}
.proftoppic img {
object-fit: cover;
object-position: center;
height: 150px;
width: 250px;
border-radius: 100px 20px 0px 100px;
}
/*** CHARACTER INFO BENEATH TOP BAR ***/
.picandlinks {
height: 10px;
width: 10px;
display: inline-block;
position: absolute;
left: 0px;
}
.profroundpic {
height: 100px;
width: 100px;
background-color: #f7f7f7;
padding: 15px;
border: 1px solid rgba(123, 83, 123, 0.5);
/****CHANGE FOR GROUP****/
border-radius: 100px;
margin: 40px;
display: inline-block;
position: absolute;
top: -20px;
left: 0px;
z-index: 10;
}
.profroundpic img {
object-fit: cover;
object-position: center;
height: 100px;
width: 100px;
border-radius: 100px;
}
.topicsposts {
width: 80px;
height: 100px;
padding: 10px 10px 0px;
margin: 1px;
background-color: transparent;
display: inline-block;
position: absolute;
left: 140px;
top: 32px;
z-index: 11;
}
.topicsposts g {
height: 15px;
width: 15px;
padding: 8px 10px 10px 10px;
border-radius: 100px;
background-color: rgba(202, 186, 202, 1);
/****CHANGE FOR GROUP****/
font-size: 15px;
color: #fff;
position: absolute;
display: inline-block;
left: 35px;
top: -10px;
}
.topicsposts h {
height: 15px;
width: 15px;
padding: 8px 10px 10px 10px;
border-radius: 100px;
background-color: rgba(202, 186, 202, 1);
/****CHANGE FOR GROUP****/
font-size: 15px;
color: #fff;
position: relative;
display: inline-block;
left: 35px;
top: 25px;
}
.topicsposts j {
height: 15px;
width: 15px;
padding: 8px 10px 10px 10px;
border-radius: 100px;
background-color: rgba(202, 186, 202, 1);
/****CHANGE FOR GROUP****/
font-size: 15px;
color: #fff;
position: relative;
display: inline-block;
top: 68px;
left: -15px;
}
.topicsposts g:hover {
background-color: rgba(163, 135, 163, 1);
/****CHANGE FOR GROUP****/
transition: ease-in 0.3s;
cursor: crosshair;
}
.topicsposts h:hover {
background-color: rgba(163, 135, 163, 1);
/****CHANGE FOR GROUP****/
transition: ease-in 0.3s;
cursor: crosshair;
}
.topicsposts j:hover {
background-color: rgba(163, 135, 163, 1);
/****CHANGE FOR GROUP****/
transition: ease-in 0.3s;
cursor: crosshair;
}
.topicsposts a {
font-size: 15px;
color: #fff;
text-decoration: none;
}
.hiddenbubbleone {
height: 170px;
width: 200px;
border-radius: 150px;
background-color: #f7f7f7;
position: absolute;
z-index: 9;
top: 150px;
left: 10px;
}
.charinfo {
width: 870px;
height: 100px;
border-radius: 2px;
background-color: #eee;
padding: 20px;
margin: 15px;
position: absolute;
right: 0px;
font-family: poppins;
display: block;
}
.charinfo f {
font-size: 25px;
height: 25px;
color: rgba(247, 247, 247, 1);
letter-spacing: 1px;
padding: 5px 20px 0px 20px;
margin-top: 30px;
font-family: staatliches;
letter-spacing: 4px;
display: block;
text-shadow: 1px -1px 0px rgba(125, 131, 137, 0.5), -1px 1px 0px rgba(125, 131, 137, 0.5), 1px 1px 0px rgba(125, 131, 137, 0.5), -1px -1px 0px rgba(125, 131, 137, 0.5);
}
.charinfo k {
padding: 5px 15px;
margin: 5px;
border-radius: 5px;
height: 10px;
font-size: 10px;
color: #888888;
text-transform: uppercase;
letter-spacing: 2px;
text-shadow: 1px -1px 0px rgba(255, 255, 255, 0.2), -1px 1px 0px rgba(255, 255, 255, 0.2), 1px 1px 0px rgba(255, 255, 255, 0.2), -1px -1px 0px rgba(255, 255, 255, 0.2);
}
/******** POSTING AREA *********/
.postarea {
min-height: 600px;
width: 720px;
padding: 30px;
font-family: poppins;
font-size: 12px;
color: #888;
letter-spacing: 1px;
text-align: left;
background-color: rgba(255, 255, 255, 0.6);
border-top: 40px solid #eee;
border-left: 1px solid #eee;
border-bottom: 1px solid #eee;
border-right: 1px solid #eee;
border-radius: 5px;
position: absolute;
display: inline-block;
top: 320px;
left: 20px;
}
.postdatetime {
width: 300px;
font-family: montserrat;
font-size: 10px;
letter-spacing: 2px;
text-align: left;
text-transform: uppercase;
color: #666;
position: absolute;
top: 335px;
left: 40px;
z-index: 10;
}
.postdatetime a {
text-decoration: none;
color: rgba(123, 83, 123, 1);
/****CHANGE FOR GROUP****/
cursor: crosshair;
}
.posteditbuttons {
width: 250px;
font-family: montserrat;
font-size: 10px;
letter-spacing: 1px;
text-align: right;
text-transform: uppercase;
color: #666;
position: absolute;
top: 335px;
right: 320px;
z-index: 10;
}
.posteditbuttons a {
text-decoration: none;
color: rgba(123, 83, 123, 1);
/****CHANGE FOR GROUP****/
cursor: crosshair;
margin-left: 10px;
display: inline-block;
}
/******** MINI PROFILE ********/
.miniholder {
height: 400px;
width: 230px;
padding: 25px 15px;
border-radius: 5px;
border: 1px solid #eee;
background-image: linear-gradient( to bottom, rgba(202, 186, 202, 0.4), rgba(123, 83, 123, 0.3));
/****CHANGE FOR GROUP****/
position: absolute;
display: inline-block;
top: 320px;
right: 20px;
}
.miniarea {
height: 400px;
width: 230px;
background-color: #fff;
}
/*****BOTTOM INFO******/
.bottomcontainer {
width: 1100px;
height: 550px;
border-radius: 0px 0px 10px 10px;
background-image: linear-gradient( rgba(255, 255, 255, 0.2), rgba(202, 186, 202, 0.5));
/****CHANGE FOR GROUP****/
position: absolute;
z-index: 0;
bottom: 0px;
}
/******** SHIP STATUS *******/
.shipinfo {
width: 450px;
height: 180px;
padding: 10px;
border-radius: 15px 2px 2px 15px;
border: 1px solid #ddd;
background-color: rgba(255, 255, 255, 0.7);
position: relative;
top: 205px;
display: inline-block;
}
.shipinfo1 {
height: 160px;
background-color: #fff;
border: 1px dashed #eee;
padding: 10px;
border-radius: 15px 2px 2px 15px;
}
.shipstatus {
width: 220px;
height: 100px;
position: absolute;
top: 50px;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
}
.shipstatus d {
display: block;
height: 20px;
margin-top: 25px;
font-family: poppins;
text-transform: uppercase;
font-size: 12px;
letter-spacing: 1px;
color: #aaa;
}
.shipstatus a {
display: block;
height: 20px;
margin-top: 5px;
font-family: staatliches;
font-size: 20px;
letter-spacing: 1px;
color: rgba(123, 83, 123, 0.6);
/****CHANGE FOR GROUP****/
text-decoration: none;
cursor: crosshair;
}
.partnergif {
width: 180px;
height: 120px;
background-color: #fff;
position: absolute;
display: inline-block;
right: 40px;
top: 35px;
z-index: 1;
}
.partnergif img {
object-fit: cover;
object-position: center;
width: 180px;
height: 120px;
border: 5px solid #fff;
border-radius: 2px;
box-shadow: 1px 1px 0px #ddd, -1px -1px 0px #ddd;
}
.shipgrad {
height: 160px;
width: 50px;
background-image: linear-gradient( rgba(202, 186, 202, 0.2), rgba(123, 83, 123, 0.3));
/****CHANGE FOR GROUP****/
position: absolute;
right: 20px;
top: 20px;
z-index: 0;
}
/****** TRIGGERS ******/
.triggersinfo {
width: 450px;
height: 180px;
padding: 10px;
border-radius: 2px 15px 15px 2px;
border: 1px solid #ddd;
background-color: rgba(255, 255, 255, 0.7);
position: relative;
top: 205px;
display: inline-block;
}
.triggersinfo1 {
height: 160px;
background-color: #fff;
border: 1px dashed #eee;
padding: 10px;
border-radius: 2px 15px 15px 2px;
}
.triggersgrad {
height: 160px;
width: 50px;
background-image: linear-gradient( rgba(202, 186, 202, 0.2), rgba(123, 83, 123, 0.3));
/****CHANGE FOR GROUP****/
position: absolute;
}
.triggersicon {
height: 30px;
width: 30px;
padding: 12px 15px 16px 15px;
border-radius: 2px;
background-color: #fff;
border: 1px solid #eee;
color: #aaa;
font-size: 30px;
position: absolute;
top: 70px;
left: 35px;
}
.trigiconpulse {
height: 30px;
width: 30px;
border-radius: 50px;
position: absolute;
top: 15px;
background-color: transparent;
box-shadow: 0 0 0 0 rgba(0, 0, 0, 1);
transform: scale(1);
animation: pulse 2s infinite;
}
#keyframes pulse {
0% {
transform: scale(0.95);
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
}
70% {
transform: scale(1);
box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
}
100% {
transform: scale(0.95);
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
}
}
.triggersheader {
width: 300px;
height: 30px;
padding-bottom: 30px;
font-size: 30px;
font-family: staatliches;
text-transform: uppercase;
color: #aaa;
letter-spacing: 2px;
position: absolute;
left: 130px;
border-bottom: 1px dashed #ddd;
}
.triggersheader w {
font-family: montserrat;
font-size: 10px;
letter-spacing: 1px;
display: block;
border-top: 1px dashed #ddd;
padding: 5px;
}
.triggersheader ion-icon {
position: relative;
top: 2px;
font-size: 11px;
}
.triggersbox {
height: 70px;
width: 300px;
padding: 10px 15px;
background-color: #f7f7f7;
overflow: auto;
font-family: poppins;
color: #aaa;
font-size: 11px;
text-align: justify;
position: absolute;
top: 90px;
left: 115px;
}
/*** OTHER LINKS ***/
.otherlinks {
height: 90px;
width: 1030px;
padding: 10px 20px 20px 20px;
background-color: rgba(255, 255, 255, 0.6);
border-radius: 15px;
border: 1px solid #ddd;
display: block;
position: relative;
top: 210px;
}
.otherlinksleft {
height: 60px;
width: 400px;
padding-top: 20px;
display: inline-block;
float: left;
overflow: hidden;
}
.otherlinks g {
height: 20px;
width: 20px;
padding: 15px 20px;
border-radius: 8px;
background-color: rgba(202, 186, 202, 0.4);
/***CHANGE TO GROUP COLOR***/
margin: 5px;
box-shadow: 1px -1px 0px rgba(255, 255, 255, 1), -1px 1px 0px rgba(255, 255, 255, 1), 1px 1px 0px rgba(255, 255, 255, 1), -1px -1px 0px rgba(255, 255, 255, 1);
display: inline-block;
}
.otherlinks g:hover {
background-image: linear-gradient( rgba(222, 212, 222, 0.2), rgba(163, 135, 163, 0.3));
/***CHANGE TO GROUP COLOR***/
}
.otherlinks a {
font-size: 20px;
color: #fff;
text-decoration: none;
text-shadow: 1px -1px 0px rgba(163, 135, 163, 0.5), -1px 1px 0px rgba(163, 135, 163, 0.5), 1px 1px 0px rgba(163, 135, 163, 0.5), -1px -1px 0px rgba(163, 135, 163, 0.5);
}
.otherlinksright {
height: 100px;
width: 620px;
display: inline-block;
border-left: 1px dashed #eee;
font-family: montserrat;
float: right;
}
.aliasinfoleft {
height: 100px;
width: 160px;
display: inline-block;
float: left;
margin-right: 10px;
}
.aliasinfoleft k {
display: block;
width: 150px;
height: 10px;
background-color: #fafafa;
padding: 8px 20px 15px 5px;
}
.aliasinfoleft l {
width: 50px;
font-size: 15px;
border-right: 1px dashed #bbb;
color: rgba(163, 135, 163, 1);
/***CHANGE TO GROUP COLOR***/
float: left;
}
.aliasinfoleft m {
font-size: 10px;
text-transform: lowercase;
float: right;
color: #aaa;
letter-spacing: 1px;
padding-top: 2px;
}
.aliasinfomid {
height: 100px;
width: 200px;
display: inline-block;
float: left;
margin-left: 10px;
font-family: montserrat;
font-size: 11px;
}
.aliasinfomid k {
display: block;
width: 175px;
height: 25px;
background-color: #fafafa;
padding: 8px 20px 15px 5px;
}
.aliasinfomid l {
width: 70px;
font-size: 25px;
border-right: 1px dashed #bbb;
color: rgba(163, 135, 163, 1);
/***GROUP COLOR***/
padding-top: 3px;
float: left;
}
.aliasinfomid m {
font-size: 12px;
text-transform: lowercase;
float: right;
color: #aaa;
letter-spacing: 1px;
padding-top: 7px;
overflow: hidden;
}
.aliasname {
height: 60px;
width: 200px;
padding: 25px 15px 15px 15px;
font-size: 11px;
letter-spacing: 2px;
display: inline-block;
float: right;
color: #aaa;
}
.aliasname n {
display: block;
font-size: 22px;
letter-spacing: 1px;
font-family: poppins;
font-weight: bold;
}
<div id="g-<!-- |g_id| -->">
<center>
<div class="posting">
<a name='entry<!-- |pid| -->'></a>
<div class="proftop">
<div class="proftopname">
<!-- |name| -->
</div>
<div class="fakebar1"></div>
<div class="fakebar2"></div>
<div class="proftoppic">
<img src="<!-- |field_24| -->">
</div>
</div>
<div class="picandlinks">
<div class="profroundpic"><img src="<!-- |field_25| -->"></div>
<div class="topicsposts">
<a href="/index.php?act=Search&CODE=getalluser&mid=<!-- |poster_id| -->&type=topics">
<g>
<ion-icon name="folder-open"></ion-icon>
</g>
</a>
<a href="/index.php?act=Search&CODE=getalluser&mid=<!-- |poster_id| -->&type=posts">
<h>
<ion-icon name="bookmarks"></ion-icon>
</h>
</a>
<a href="/index.php?act=Msg&CODE=04&MID=<!-- |poster_id| -->">
<j>
<ion-icon name="mail"></ion-icon>
</j>
</a>
</div>
</div>
<div class="hiddenbubbleone"></div>
<div class="charinfo">
<f>
<!-- |field_3| -->
</f>
<k>
<!-- |field_8| -->
</k>
<k>
<!-- |field_2| -->
</k>
<k>
<!-- |field_4| -->
</k>
<k>
<!-- |field_5| -->/
<!-- |field_6| -->
</k>
<k>
<!-- |field_7| -->
</k>
</div>
<div class="postdatetime">
<a href="<!-- |permalink| -->">
<ion-icon name="arrow-redo"></ion-icon>
</a>
<!-- |post_date| -->
</div>
<div class="posteditbuttons">
<!-- |mod_checkbox| -->
<!-- |edit_button| -->
<!-- |quote_button| -->
<!-- |delete_button| -->
<!-- |report_link| -->
</div>
<div class="postarea">
<!-- |post| -->
</div>
<div class="miniholder">
<div class="miniarea">
<!-- |mini_profile| -->
</div>
</div>
<div class="bottomcontainer">
<div class="shipinfo">
<div class="shipinfo1">
<div class="shipstatus">
<d>
<!-- |field_9| -->
</d>
<a href="<!-- |field_11| -->">
<!-- |field_10| -->
</a>
</div>
<div class="partnergif"><img src="<!-- |field_23| -->"></div>
<div class="shipgrad"></div>
</div>
</div>
<div class="triggersinfo">
<div class="triggersinfo1">
<div class="triggersgrad"></div>
<div class="triggersicon">
<ion-icon name="alert-circle"></ion-icon>
<div class="trigiconpulse"></div>
</div>
<div class="triggersheader">triggers
<w>please tag
<ion-icon name="warning-sharp"></ion-icon>
</w>
</div>
<div class="triggersbox">
<!-- |field_22| -->
</div>
</div>
</div>
<div class="otherlinks">
<div class="otherlinksleft">
<g>
<a href="DIRECTORY">
<ion-icon name="id-card"></ion-icon>
</a>
</g>
<g>
<a href="<!-- |field_12| -->" alt="character dev">
<ion-icon name="color-palette"></ion-icon>
</a>
</g>
<g>
<a href="<!-- |field_13| -->" alt="ship dev">
<ion-icon name="heart-half"></ion-icon>
</a>
</g>
<g>
<a href="<!-- |field_14| -->" alt="instagram">
<ion-icon name="logo-instagram"></ion-icon>
</a>
</g>
<g>
<a href="<!-- |field_15| -->" alt="request">
<ion-icon name="pricetags"></ion-icon>
</a>
</g>
</div>
<div class="otherlinksright">
<div class="aliasinfoleft">
<k>
<l>
<ion-icon name="fitness"></ion-icon>
</l>
<m>
<!-- |field_16| -->
</m>
</k>
<k style="border-bottom: 1px dashed #DDD; border-top: 1px dashed #DDD;">
<l>
<ion-icon name="shirt"></ion-icon>
</l>
<m>
<!-- |field_17| -->
</m>
</k>
<k>
<l>
<ion-icon name="earth"></ion-icon>
</l>
<m>
<!-- |field_18| -->
</m>
</k>
</div>
<div class="aliasinfomid">
<k>
<l>
<ion-icon name="eye-off"></ion-icon>
</l>
<m>
<!-- |field_19| -->
</m>
</k>
<k style="margin-top: 5px;">
<l>
<ion-icon name="flash"></ion-icon>
</l>
<m>
<!-- |field_20| -->
</m>
</k>
</div>
<div class="aliasname">written by
<n>
<!-- |field_21| -->
</n>
</div>
</div>
</div>
<div style="clear: both;"></div>
</div>
</div>
</center>
</div>
Seeing your code, I will guess you do not understand much of what the code is doing.
Here there is a minimal version of something I would imagine is what you are looking for.
When you use float, the element stops taking space by itself and start to float inside its parent, so in your case, you shouldn't use it.
// Get all comments with class 'comment'
const comment = document.querySelectorAll('.comment');
// Iterate the comments in order to make it multiple
comment.forEach( function(element) {
// Add click to every element
element.addEventListener('click',function() {
// Remove class to make it full size
this.classList.remove('short_comment');
//Get the button of that block and make it dissapear
var button_read_more = this.querySelectorAll('.read_more');
button_read_more[0].remove();
});
});
footer {
width: 100%;
background: green;
}
footer div {
padding: 50px;
}
/* No floating */
.short_comment .content {
max-height: 25px;
background: yellow;
overflow: hidden;
}
<div class="comment short_comment">
<p class="content">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
</p>
<button class="read_more">read all</button>
</div>
<footer>
<div>This is the footer</div>
</footer>
This question already has answers here:
Break long word with CSS
(6 answers)
Closed last year.
In the example code - I have given box 3 and box 4 widths of 200px I don't actually care for using these widths, but I have given them colours so you can see my problem better visually.
The problem is my text is not being contained by the parent <div> with a set (hardcoded) pixel width in box 3 especially it runs waaay out to the right in 1 line instead of wrapping inside the <div>. For box 4, I can understand it's trying to stretch to the end, but if it were any longer it would again just run outside of the grid anyways. So theres something I'm missing to help wrap content. How do I solve this problem?
* {
margin:0;
padding:0;
}
html {
box-sizing: border-box;
font-size: 30px;
font-family: 'Bitter', serif;
}
body{
background: rgb(7, 7, 7);
color: #fff;
}
.imgContainer{
width: 100%;
height: fit-content;
background-color: black;
pointer-events: none;
user-select: none;
}
.mySlides {
opacity: 0.5;
overflow: hidden;
background-position: center;
width: 100%;
height: 650px;
max-height: 75vh;
pointer-events: none;
user-select: none;
}
.bodyC {
padding-top: 75px;
max-width: 360px;
font-weight: 200;
font-size: 0.8rem;
}
.bodyC2 {
padding-left: 180px;
padding-top: 250px;
max-width: 450px;
font-weight: 200;
font-size: 0.8rem;
}
.bodyContainer {
display: flex;
width: 100%;
padding-right: 80px;
padding-bottom: 80px;
justify-content: center;
min-height: 50vh;
}
h3 {
font-size: 36px;
margin-bottom:10px;
font-weight: 700;
}
h4 {
text-transform: uppercase;
font-weight: 700;
font-size: 27px;
margin-bottom:10px;
}
.logobutton {
padding-right: 45px;
user-select: none;
}
.homenugget{
height:70px;
width:50px;
position:fixed;
top: 5px;
left: 32px;
opacity:0;
user-select: none;
}
.smallu {
height: 50px;
width:50px;
user-select: none;
}
.container {
margin: 0 auto;
display:flex;
align-items: center;
justify-content: space-between;
}
nav {
position:relative;
top: 0;
left: 0;
right: 0;
z-index: 99;
background-color: #212121;
padding: 16px 32px;
border-bottom: 3px solid rgb(37, 164, 173);
}
h1 {
color: #ffffff ;
font-size: 28px;
font-weight: 900;
letter-spacing: 1px;
text-transform: uppercase;
}
.hamburger {
display: block;
position: relative;
z-index: 1;
user-select: none;
appearance: none;
border: none;
outline: none;
background: none;
cursor: pointer;
}
.hamburger span {
display: block;
width: 33px;
height: 4px;
margin-bottom: 5px;
position: relative;
background-color: #eeeeee;
border-radius: 6px;
z-index: 1;
transform-origin: 0 0;
transition: 0.4s;
}
.hamburger:hover span:nth-child(2) {
transform: translateX(10px);
background-color: rgb(37, 164, 173);
}
.hamburger.is-active span:nth-child(1) {
transform: translate(0px, -2px) rotate(45deg);
background-color: rgb(37, 164, 173);
}
.hamburger.is-active span:nth-child(2) {
opacity: 0;
transform: translateX(15px);
}
.hamburger.is-active span:nth-child(3) {
transform: translate(-3px, 3px) rotate(-45deg);
background-color:rgb(37, 164, 173);
}
.hamburger.is-active:hover span {
background-color: rgb(75, 243, 255);
filter: blur(0.5px);
box-shadow: 1px -1px rgb(75, 243, 255);
}
.menu {
display:none;
flex: 1 1 0%;
justify-content: center;
margin: 0 -16;
letter-spacing: 2px;
}
.menu a{
color: ivory;
margin: 0 16;
font-weight: 700;
text-decoration: none;
transition: 0.4s;
padding: 5px 16px;
border-radius: 50px;
}
.menu a.is-active, .menu a:hover{
background-color: rgba(88, 223, 233, 0.295);
color: rgb(75, 243, 255);
}
.dropdown {
position: relative;
}
.dropdownMenu {
position: absolute;
width: 300px;
z-index: 100;
right: -60px;
top: calc(100% + 32px);
border-top: 1px solid rgb(75, 243, 255);
border-bottom: 3px solid rgb(75, 243, 255);
border-left: 3px solid rgb(55, 225, 240);
background-color: #212121;
border-radius: 0 0 15px 15px;
opacity: 0;
}
.link{
display: block;
text-align: left;
margin: 10px;
font-size: 30px;
color: ivory;
text-decoration: none;
opacity: 1;
}
.dropdownMenu a:hover {
background-color: rgba(88, 223, 233, 0.295);
border-radius: 5px;
color: rgb(75, 243, 255);
text-decoration: none;
opacity: 1;
}
.wth{
padding-bottom: 1000px;
}
.footer {
position: relative;
width: 100%;
bottom: 0 ;
text-align: left;
background-color: #212121;
padding:50px 0 50px 0;
}
.footer-container {
margin-left: 1em;
}
.footer h5 {
color: #fff;
}
.footer h5 {
margin-bottom: 20px;
}
.footer p {
color: rgba(255, 255, 255, 0.25);
font-size:16px;
line-height:22px;
}
.hearted {
color:red;
font-size: 12px;
}
.opacityStyle{
opacity: 1;
}
.subscribe {
width: 100%;
background-color: rgb(92, 89, 89);
background-image: url('../images/backgrounds/parallax-bg.jpg');
background-attachment: fixed;
background-repeat: no-repeat;
background-position: 50% 0;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
position: relative;
}
.subscribe >.sub-container {
padding-top: 80px;
padding-bottom: 80px;
}
.subscribe-title h2 {
font-weight: 600;
font-size: 23px;
color: #fff;
letter-spacing:3px;
margin:0 3%;
line-height:70px;
text-transform:uppercase;
}
.subscribe-form {
margin-top: 6px;
}
.subscribe-form input[type=text] {
width: 65%;
height: 60px;
display: block;
padding: 0 20px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 10px;
-webkit-border-top-left-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
-moz-border-radius-topleft: 10px;
-moz-border-radius-bottomleft: 10px;
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
line-height: 60px;
letter-spacing:1px;
font-size:15px;
font-weight:300;
float: left;
}
.subscribe-form input:focus {
outline: 0;
}
.subscribe-form input[type=submit] {
width: 35%;
height: 62px;
display: flex;
position: absolute;
right: 5px;
justify-content: center;
background-color: rgb(35, 142, 151);
border: 1px solid rgb(35, 142, 151);
color: #fff;
-webkit-border-top-right-radius: 10px;
-webkit-border-bottom-right-radius: 10px;
-moz-border-radius-topright: 10px;
-moz-border-radius-bottomright: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
font-weight: 700;
font-size: 33px;
transition: all 0.125s ease-in-out 0s;
-moz-transition: all 0.125s ease-in-out 0s;
-webkit-transition: all 0.125s ease-in-out 0s;
-o-transition: all 0.125s ease-in-out 0s;
-ms-transition: all 0.125s ease-in-out 0s;
}
.subscribe-form input[type=submit]:hover {
background-color: rgb(23, 90, 95);
border: 1px solid rgb(23, 90, 95);
color:rgb(75, 243, 255);
}
.error_message {
color:#fc6e51;
padding-bottom:15px;
font-size:13px;
line-height:30px;
}
#success_page {
color:#9ce726;
padding-bottom:10px;
font-size:12px;
}
#success_page h3 {
font-size:17px;
font-weight:400px;
color:#4ab217;
}
#success_page p {
font-size:12px;
font-weight:400px;
color:#b3b3b3;
}
.box1 {
grid-column: 1/4;
text-align: center;
background: chartreuse;
}
.box2 {
grid-column: 1 / 2;
grid-row: 2/2;
width:300px;
height: 300px;
background:blueviolet
}
.box3 {
width: 200px;
grid-column: 2/3 ;
grid-row:2/3;
background: blue;
}
.box4 {
width: 200px;
grid-column: 1/4;
grid-row:4/4;
background: #fc6e51;
}
.wrapper{
display: grid;
grid-template-columns: repeat(3, auto);
grid-template-rows: repeat(1, 1fr);
gap:10px;
max-height: 55vh;
background: #212121;
}
.megawrap{
display: grid;
grid-auto-flow: column;
height: 350px;
width: 200px;
gap: 20px;
}
#media (min-width: 1080px){
.bodyC2{
max-width: 360px;
padding-left: 150px;
}
.bodyC2{
flex-direction: column;
padding-top: 200px;
padding:50px;
padding-left: 200px;
margin-left: 100px;
}
.bodyC {
padding:50px;
margin-left: 25px;
}
}
#media (max-width: 1175px){
.bodyC2{
max-width: 360px;
padding-left: 75px;
}
.bodyC2{
flex-direction: column;
padding-top: 200px;
padding:50px;
padding-left: 0px;
margin-left: 50px;
}
.bodyC {
padding:50px;
margin-left: 25px;
}
}
#media (max-width: 1400px){
.bodyC2{
max-width: 360px;
padding-left: 75px;
}
.bodyC2{
flex-direction: column;
padding-top: 200px;
padding:50px;
padding-left: 0px;
margin-left: 100px;
}
.bodyC {
padding:50px;
margin-left: 25px;
}
}
#media (min-width: 975px) {
.hamburger{
display: none;
}
.dropdown {
display: none;
}
.menu{
display:flex;
}
.bodyContainer{
flex-direction: row;
}
.bodyC2{
flex-direction: column;
padding-top: 100px;
}
}
#media (max-width: 975px){
.bodyContainer{
flex-direction: column;
}
.bodyC2{
flex-direction: column;
padding-top: 50px;
font-size: .8em;
margin-left: 150px;
}
.bodyC {
font-size: .8em;
margin-left: 50px;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>III</title>
<link rel="stylesheet" href="main.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Dosis:wght#200;300;400;500;600;700;800&family=Roboto+Mono:ital,wght#0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,200;1,300;1,400;1,500;1,600;1,700&family=Rock+3D&display=swap" rel="stylesheet">
</head>
<body>
<nav>
<div class="container">
<div class="logobutton">
<img class="smallu" src="images/ulogo-white.jpg">
<a class="homenugget" href="home.html"></a>
</div>
<h1>Ideas Imprint</h1>
<div class="menu">
Events
About
Login
Dashboard
</div>
<div class="dropdown">
<button class="hamburger">
<span> </span>
<span></span>
<span></span>
</button>
<div class="dropdownMenu">
Events
About
Login
Dashboard
</div>
</div>
</div>
< /nav>
<div class="megawrap">
<div class="wrapper">
<div class="box1">Hello I'm a Head</div>
<img class="box2" src="images/7.jpg" alt="">
<div class= "box3">
box3box3box3box3box3box3box3box3box3box3box3box3
</div>
<div class= "box4">
box4box4box4box4box4box4box4box4box4box4box4
</div>
</div>
<div class="wrapper">
<div class="box1">Hello I'm a Head</div>
<img class="box2" src="images/7.jpg" alt="">
<div class= "box3">
box3box3box3box3box3box3box3box3box3box3box3
</div>
<div class= "box4">
box4box4box4box4box4box4box4box
</div>
</div>
<div class="wrapper">
<div class="box1">Hello I'm a Head</div>
<img class="box2" src="images/7.jpg" alt="">
<div class= "box3">
box3box3box3box3box3box3box3box3box3box3box3box3
</div>
<div class= "box4">
box4box4box4box4box4box4box4box4box
</div>
</div>
</div>
<div class="wth"></div>
<!-- Footer section -->
<footer class="footer">
<div class="footer-container">
<div class="footer-row">
<div class="Footer-text-left">
<p>Copyright © 2022 Ideas Imprint Inc. All Rights Reserved.</p>
<p> Made with <span class="hearted"> ❤</span></p>
</div>
</div>
</div>
<!-- footer top -->
</footer>
<!-- Footer section -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="main.js"></script>
</body>
</html>
Make use of word-wrap property. Add word-wrap: break-word; on your .box3 and .box4 classes. More on it here.
* {
margin: 0;
padding: 0;
}
html {
box-sizing: border-box;
font-size: 30px;
font-family: 'Bitter', serif;
}
body {
background: rgb(7, 7, 7);
color: #fff;
}
.imgContainer {
width: 100%;
height: fit-content;
background-color: black;
pointer-events: none;
user-select: none;
}
.mySlides {
opacity: 0.5;
overflow: hidden;
background-position: center;
width: 100%;
height: 650px;
max-height: 75vh;
pointer-events: none;
user-select: none;
}
.bodyC {
padding-top: 75px;
max-width: 360px;
font-weight: 200;
font-size: 0.8rem;
}
.bodyC2 {
padding-left: 180px;
padding-top: 250px;
max-width: 450px;
font-weight: 200;
font-size: 0.8rem;
}
.bodyContainer {
display: flex;
width: 100%;
padding-right: 80px;
padding-bottom: 80px;
justify-content: center;
min-height: 50vh;
}
h3 {
font-size: 36px;
margin-bottom: 10px;
font-weight: 700;
}
h4 {
text-transform: uppercase;
font-weight: 700;
font-size: 27px;
margin-bottom: 10px;
}
.logobutton {
padding-right: 45px;
user-select: none;
}
.homenugget {
height: 70px;
width: 50px;
position: fixed;
top: 5px;
left: 32px;
opacity: 0;
user-select: none;
}
.smallu {
height: 50px;
width: 50px;
user-select: none;
}
.container {
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
}
nav {
position: relative;
top: 0;
left: 0;
right: 0;
z-index: 99;
background-color: #212121;
padding: 16px 32px;
border-bottom: 3px solid rgb(37, 164, 173);
}
h1 {
color: #ffffff;
font-size: 28px;
font-weight: 900;
letter-spacing: 1px;
text-transform: uppercase;
}
.hamburger {
display: block;
position: relative;
z-index: 1;
user-select: none;
appearance: none;
border: none;
outline: none;
background: none;
cursor: pointer;
}
.hamburger span {
display: block;
width: 33px;
height: 4px;
margin-bottom: 5px;
position: relative;
background-color: #eeeeee;
border-radius: 6px;
z-index: 1;
transform-origin: 0 0;
transition: 0.4s;
}
.hamburger:hover span:nth-child(2) {
transform: translateX(10px);
background-color: rgb(37, 164, 173);
}
.hamburger.is-active span:nth-child(1) {
transform: translate(0px, -2px) rotate(45deg);
background-color: rgb(37, 164, 173);
}
.hamburger.is-active span:nth-child(2) {
opacity: 0;
transform: translateX(15px);
}
.hamburger.is-active span:nth-child(3) {
transform: translate(-3px, 3px) rotate(-45deg);
background-color: rgb(37, 164, 173);
}
.hamburger.is-active:hover span {
background-color: rgb(75, 243, 255);
filter: blur(0.5px);
box-shadow: 1px -1px rgb(75, 243, 255);
}
.menu {
display: none;
flex: 1 1 0%;
justify-content: center;
margin: 0 -16;
letter-spacing: 2px;
}
.menu a {
color: ivory;
margin: 0 16;
font-weight: 700;
text-decoration: none;
transition: 0.4s;
padding: 5px 16px;
border-radius: 50px;
}
.menu a.is-active,
.menu a:hover {
background-color: rgba(88, 223, 233, 0.295);
color: rgb(75, 243, 255);
}
.dropdown {
position: relative;
}
.dropdownMenu {
position: absolute;
width: 300px;
z-index: 100;
right: -60px;
top: calc(100% + 32px);
border-top: 1px solid rgb(75, 243, 255);
border-bottom: 3px solid rgb(75, 243, 255);
border-left: 3px solid rgb(55, 225, 240);
background-color: #212121;
border-radius: 0 0 15px 15px;
opacity: 0;
}
.link {
display: block;
text-align: left;
margin: 10px;
font-size: 30px;
color: ivory;
text-decoration: none;
opacity: 1;
}
.dropdownMenu a:hover {
background-color: rgba(88, 223, 233, 0.295);
border-radius: 5px;
color: rgb(75, 243, 255);
text-decoration: none;
opacity: 1;
}
.wth {
padding-bottom: 1000px;
}
.footer {
position: relative;
width: 100%;
bottom: 0;
text-align: left;
background-color: #212121;
padding: 50px 0 50px 0;
}
.footer-container {
margin-left: 1em;
}
.footer h5 {
color: #fff;
}
.footer h5 {
margin-bottom: 20px;
}
.footer p {
color: rgba(255, 255, 255, 0.25);
font-size: 16px;
line-height: 22px;
}
.hearted {
color: red;
font-size: 12px;
}
.opacityStyle {
opacity: 1;
}
.subscribe {
width: 100%;
background-color: rgb(92, 89, 89);
background-image: url('../images/backgrounds/parallax-bg.jpg');
background-attachment: fixed;
background-repeat: no-repeat;
background-position: 50% 0;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
position: relative;
}
.subscribe>.sub-container {
padding-top: 80px;
padding-bottom: 80px;
}
.subscribe-title h2 {
font-weight: 600;
font-size: 23px;
color: #fff;
letter-spacing: 3px;
margin: 0 3%;
line-height: 70px;
text-transform: uppercase;
}
.subscribe-form {
margin-top: 6px;
}
.subscribe-form input[type=text] {
width: 65%;
height: 60px;
display: block;
padding: 0 20px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 10px;
-webkit-border-top-left-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
-moz-border-radius-topleft: 10px;
-moz-border-radius-bottomleft: 10px;
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
line-height: 60px;
letter-spacing: 1px;
font-size: 15px;
font-weight: 300;
float: left;
}
.subscribe-form input:focus {
outline: 0;
}
.subscribe-form input[type=submit] {
width: 35%;
height: 62px;
display: flex;
position: absolute;
right: 5px;
justify-content: center;
background-color: rgb(35, 142, 151);
border: 1px solid rgb(35, 142, 151);
color: #fff;
-webkit-border-top-right-radius: 10px;
-webkit-border-bottom-right-radius: 10px;
-moz-border-radius-topright: 10px;
-moz-border-radius-bottomright: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
font-weight: 700;
font-size: 33px;
transition: all 0.125s ease-in-out 0s;
-moz-transition: all 0.125s ease-in-out 0s;
-webkit-transition: all 0.125s ease-in-out 0s;
-o-transition: all 0.125s ease-in-out 0s;
-ms-transition: all 0.125s ease-in-out 0s;
}
.subscribe-form input[type=submit]:hover {
background-color: rgb(23, 90, 95);
border: 1px solid rgb(23, 90, 95);
color: rgb(75, 243, 255);
}
.error_message {
color: #fc6e51;
padding-bottom: 15px;
font-size: 13px;
line-height: 30px;
}
#success_page {
color: #9ce726;
padding-bottom: 10px;
font-size: 12px;
}
#success_page h3 {
font-size: 17px;
font-weight: 400px;
color: #4ab217;
}
#success_page p {
font-size: 12px;
font-weight: 400px;
color: #b3b3b3;
}
/* ------------------------------------------------------------------------------
THE IMPORTANT PART
-------------------------------------------------------------------------------*/
.box1 {
grid-column: 1/4;
text-align: center;
background: chartreuse;
}
.box2 {
grid-column: 1 / 2;
grid-row: 2/2;
width: 300px;
height: 300px;
background: blueviolet
}
.box3 {
width: 200px;
grid-column: 2/3;
grid-row: 2/3;
background: blue;
word-wrap: break-word;
}
.box4 {
width: 200px;
grid-column: 1/4;
grid-row: 4/4;
background: #fc6e51;
word-wrap: break-word;
}
.wrapper {
display: grid;
grid-template-columns: repeat(3, auto);
grid-template-rows: repeat(1, 1fr);
gap: 10px;
max-height: 55vh;
background: #212121;
}
.megawrap {
display: grid;
grid-auto-flow: column;
height: 350px;
width: 200px;
gap: 20px;
}
/* ------------------------------------------------------------------------------
THE IMPORTANT PART END
-------------------------------------------------------------------------------*/
#media (min-width: 1080px) {
.bodyC2 {
max-width: 360px;
padding-left: 150px;
}
.bodyC2 {
flex-direction: column;
padding-top: 200px;
padding: 50px;
padding-left: 200px;
margin-left: 100px;
}
.bodyC {
padding: 50px;
margin-left: 25px;
}
}
#media (max-width: 1175px) {
.bodyC2 {
max-width: 360px;
padding-left: 75px;
}
.bodyC2 {
flex-direction: column;
padding-top: 200px;
padding: 50px;
padding-left: 0px;
margin-left: 50px;
}
.bodyC {
padding: 50px;
margin-left: 25px;
}
}
#media (max-width: 1400px) {
.bodyC2 {
max-width: 360px;
padding-left: 75px;
}
.bodyC2 {
flex-direction: column;
padding-top: 200px;
padding: 50px;
padding-left: 0px;
margin-left: 100px;
}
.bodyC {
padding: 50px;
margin-left: 25px;
}
}
#media (min-width: 975px) {
.hamburger {
display: none;
}
.dropdown {
display: none;
}
.menu {
display: flex;
}
.bodyContainer {
flex-direction: row;
}
.bodyC2 {
flex-direction: column;
padding-top: 100px;
}
}
/* Once completely tiny shrink text to columns */
#media (max-width: 975px) {
.bodyContainer {
flex-direction: column;
}
.bodyC2 {
flex-direction: column;
padding-top: 50px;
font-size: .8em;
margin-left: 150px;
}
.bodyC {
font-size: .8em;
margin-left: 50px;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>III</title>
<link rel="stylesheet" href="main.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Dosis:wght#200;300;400;500;600;700;800&family=Roboto+Mono:ital,wght#0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,200;1,300;1,400;1,500;1,600;1,700&family=Rock+3D&display=swap" rel="stylesheet">
</head>
<body>
<nav>
<div class="container">
<div class="logobutton">
<img class="smallu" src="images/ulogo-white.jpg">
<a class="homenugget" href="home.html"></a>
</div>
<h1>Ideas Imprint</h1>
<div class="menu">
Events
About
Login
Dashboard
</div>
<div class="dropdown">
<button class="hamburger">
<span> </span>
<span></span>
<span></span>
</button>
<div class="dropdownMenu">
Events
About
Login
Dashboard
</div>
</div>
</div>
< /nav>
<div class="megawrap">
<div class="wrapper">
<div class="box1">Hello I'm a Head</div>
<img class="box2" src="images/7.jpg" alt="">
<div class="box3">
box3box3box3box3box3box3box3box3box3box3box3box3
</div>
<div class="box4">
box4box4box4box4box4box4box4box4box4box4box4
</div>
</div>
<div class="wrapper">
<div class="box1">Hello I'm a Head</div>
<img class="box2" src="images/7.jpg" alt="">
<div class="box3">
box3box3box3box3box3box3box3box3box3box3box3
</div>
<div class="box4">
box4box4box4box4box4box4box4box
</div>
</div>
<div class="wrapper">
<div class="box1">Hello I'm a Head</div>
<img class="box2" src="images/7.jpg" alt="">
<div class="box3">
box3box3box3box3box3box3box3box3box3box3box3box3
</div>
<div class="box4">
box4box4box4box4box4box4box4box4box
</div>
</div>
</div>
<div class="wth"></div>
<!-- Footer section -->
<footer class="footer">
<div class="footer-container">
<div class="footer-row">
<div class="Footer-text-left">
<p>Copyright © 2022 Ideas Imprint Inc. All Rights Reserved.</p>
<p> Made with <span class="hearted"> ❤</span></p>
</div>
</div>
</div>
<!-- footer top -->
</footer>
<!-- Footer section -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="main.js"></script>
</body>
</html>
So this is what I did so far :
#mybutton {
background-color: #08c2f3;
width: 200px;
height: 35px;
padding: 6px;
color: white;
font-size: 30px;
font-family: sans-serif;
text-align :center;
border: 1px solid white;
}
body {
background-color: #1599e1
}
#myBar {
width: 100%;
height: 9px;
background: white;
transform: rotateZ(-54deg);
position: relative;
left: 42px;
}
<div id="mybutton">
<span>OK</span>
<div id="myBar"></div>
</div>
but my goal is :
Just add overflow: hidden to the parent container as it will hide your unwanted portion peeping out.
#mybutton {
background-color: #08c2f3;
width: 200px;
height: 35px;
padding: 6px;
color: white;
font-size: 30px;
font-family: sans-serif;
text-align: center;
border: 1px solid white;
overflow: hidden;
}
body {
background-color: #1599e1
}
#myBar {
width: 100%;
height: 9px;
background: white;
transform: rotateZ(-54deg);
position: relative;
left: 42px;
}
<div id="mybutton">
<span>OK</span>
<div id="myBar"></div>
</div>
You don't actually need the "bar" element at all.
This can be achieved with an angled background gradient
#mybutton {
background: linear-gradient(124deg, #08c2f3 70%, white 70%, white 75%, #08c2f3 75%);
width: 200px;
height: 35px;
padding: 6px;
color: white;
font-size: 30px;
font-family: sans-serif;
text-align: center;
border: 1px solid white;
}
body {
background-color: #1599e1
}
<div id="mybutton">
<span>OK</span>
</div>
This has been really frustrating. I'm trying to add a dropdown tooltip at the bottom of my profile avatar. Unfortunately that does not seem to work properly. The tooltip seems to be partly hidden. How can i keep the specific design of the tooltip and make it display directly at the bottom of the icon with the arrow pointing in the middle of the icon?
body {
background-color: #36a4b0;
}
#shell-header {
display: flex;
height: 46px;
overflow: hidden;
z-index: 3;
opacity: 1;
white-space: nowrap;
}
.logo-wrapper {
padding-left: 56px;
}
#media (max-width: 480px) {
.logo-wrapper {
padding-left: 1rem;
}
}
.title-wrapper {
left: 0;
right: 0;
text-align: right;
flex-grow: 1;
}
.avatar-wrapper {
padding-right: 56px;
position: relative;
}
#media (max-width: 480px) {
.avatar-wrapper {
padding-right: 1rem;
}
}
.logo {
height: 30px;
line-height: 40px;
max-width: 96px;
margin-top: 0.35rem;
}
.log-shellHeaderTitle {
font-size: 20px;
line-height: 36px;
color: #fff;
text-overflow: ellipsis;
text-align: center;
display: block;
white-space: nowrap;
overflow: hidden;
font-weight: inherit;
margin-left: 0px;
margin-top: 0px;
margin-bottom: 0px;
text-shadow: 0 1px rgba(255, 255, 255, 0.5);
}
.log-langButton {
padding-right: 40px;
}
#media only screen and (max-width: 480px) {
.log-langButton {
padding-right: 10px;
}
}
#log-LangButtSwitch {
background: transparent;
cursor: pointer;
display: block;
position: relative;
float: left;
width: 40px;
padding: 2px;
margin-top: 0.25rem;
border: 2px solid #fff;
border-radius: 28px;
}
.log-switchHandle {
display: block;
background: #fff;
height: 20px;
width: 20px;
z-index: 9999;
border-radius: 20px;
}
.log-switchLabels {
position: absolute;
top: 5px;
z-index: -1;
width: 100%;
font-family: Helvetica, sans-serif;
font-weight: bold;
color: #fff;
text-transform: uppercase;
text-shadow: 0 1px rgba(255, 255, 255, 0.5);
}
.log-switchLabels:before {
content: "EN";
position: absolute;
left: 21px;
font-size: 12px;
}
.log-switchLabels:after {
content: "DE";
position: absolute;
right: 26px;
font-size: 12px;
}
.fa-user-o:before {
font-size: 1.375rem;
color: #fff;
}
.avatar {
text-align: center;
margin-top: 0.35rem;
width: 25px;
}
.log-popover {
visibility: visible;
z-index: 460;
display: block;
overflow: visible;
top: 121px;
left: 375.063px;
bottom: 10px;
transition: opacity 0.2s linear;
color: #333333;
min-width: 100px;
box-sizing: border-box;
outline: none;
max-width: 100%;
max-height: 84px;
min-height: 2rem;
overflow: hidden;
background: #ffffff;
border: none;
box-shadow: 0 0.625rem 1.875rem 0 rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.15);
border-radius: 0.25rem;
}
.log-popover a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.log-popover a:hover {
background-color: #f0f0f0;
}
.log-popover a:active,
.log-popover a:focus {
background: #e8eff6;
outline: 1px dotted #000000;
outline-offset: -2px;
}
.log-popover:after,
.log-popover:before {
bottom: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.log-popover:after {
border-color: rgba(255, 255, 255, 0);
border-bottom-color: #fff;
border-width: 10px;
margin-left: -10px;
}
.log-popover:before {
border-color: rgba(51, 51, 51, 0);
border-bottom-color: #333333;
border-width: 11px;
margin-left: -11px;
}
.log-toolContainer {
position: absolute;
height: 100%;
width: 100%;
}
<div class="log-container">
<div id="shell-header">
<div class="logo-wrapper">
<img src="https://s-media-cache-ak0.pinimg.com/236x/f7/0a/f6/f70af6169bbe3f8346e64a25d54bafea.jpg" class="logo">
</div>
<div class="title-wrapper">
<div class="log-shellHeaderTitle">Dashboard</div>
</div>
<div class="log-langButton">
<div id="log-LangButtSwitch">
<span class="log-switchHandle"></span>
<span class="log-switchLabels"></span>
</div>
</div>
<div class="avatar-wrapper">
<img class="avatar" src="https://www.talentenportaalhellendoorn.nl/thumbnails/man.png">
<div class="log-toolContainer">
<div class="log-popover">
Profile
Log out
</div>
</div>
</div>
</div>
</div>
remove overflow: hidden; from #shell-header so the menu isn't cut off, then use positioning to put the container for the menu in the bottom/left of the parent, and use translateX() to offset it 50% of it's own width + 50% of the avatar width to center it under the icon.
body {
background-color: #36a4b0;
}
#shell-header {
display: flex;
height: 46px;
z-index: 3;
opacity: 1;
white-space: nowrap;
}
.logo-wrapper {
padding-left: 56px;
}
#media (max-width: 480px) {
.logo-wrapper {
padding-left: 1rem;
}
}
.title-wrapper {
left: 0;
right: 0;
text-align: right;
flex-grow: 1;
}
.avatar-wrapper {
padding-right: 56px;
position: relative;
}
#media (max-width: 480px) {
.avatar-wrapper {
padding-right: 1rem;
}
}
.logo {
height: 30px;
line-height: 40px;
max-width: 96px;
margin-top: 0.35rem;
}
.log-shellHeaderTitle {
font-size: 20px;
line-height: 36px;
color: #fff;
text-overflow: ellipsis;
text-align: center;
display: block;
white-space: nowrap;
overflow: hidden;
font-weight: inherit;
margin-left: 0px;
margin-top: 0px;
margin-bottom: 0px;
text-shadow: 0 1px rgba(255, 255, 255, 0.5);
}
.log-langButton {
padding-right: 40px;
}
#media only screen and (max-width: 480px) {
.log-langButton {
padding-right: 10px;
}
}
#log-LangButtSwitch {
background: transparent;
cursor: pointer;
display: block;
position: relative;
float: left;
width: 40px;
padding: 2px;
margin-top: 0.25rem;
border: 2px solid #fff;
border-radius: 28px;
}
.log-switchHandle {
display: block;
background: #fff;
height: 20px;
width: 20px;
z-index: 9999;
border-radius: 20px;
}
.log-switchLabels {
position: absolute;
top: 5px;
z-index: -1;
width: 100%;
font-family: Helvetica, sans-serif;
font-weight: bold;
color: #fff;
text-transform: uppercase;
text-shadow: 0 1px rgba(255, 255, 255, 0.5);
}
.log-switchLabels:before {
content: "EN";
position: absolute;
left: 21px;
font-size: 12px;
}
.log-switchLabels:after {
content: "DE";
position: absolute;
right: 26px;
font-size: 12px;
}
.fa-user-o:before {
font-size: 1.375rem;
color: #fff;
}
.avatar {
text-align: center;
margin-top: 0.35rem;
width: 25px;
}
.log-popover {
visibility: visible;
z-index: 460;
display: block;
overflow: visible;
top: 121px;
left: 375.063px;
bottom: 10px;
transition: opacity 0.2s linear;
color: #333333;
min-width: 100px;
box-sizing: border-box;
outline: none;
max-width: 100%;
max-height: 84px;
min-height: 2rem;
overflow: hidden;
background: #ffffff;
border: none;
box-shadow: 0 0.625rem 1.875rem 0 rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.15);
border-radius: 0.25rem;
}
.log-popover a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.log-popover a:hover {
background-color: #f0f0f0;
}
.log-popover a:active,
.log-popover a:focus {
background: #e8eff6;
outline: 1px dotted #000000;
outline-offset: -2px;
}
.log-popover:after,
.log-popover:before {
bottom: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.log-popover:after {
border-color: rgba(255, 255, 255, 0);
border-bottom-color: #fff;
border-width: 10px;
margin-left: -10px;
}
.log-popover:before {
border-color: rgba(51, 51, 51, 0);
border-bottom-color: #333333;
border-width: 11px;
margin-left: -11px;
}
.log-toolContainer {
position: absolute;
height: 100%;
width: 100%;
top: 100%;
left: 0;
transform: translateX(calc(-50% + 12.5px));
}
<div class="log-container">
<div id="shell-header">
<div class="logo-wrapper">
<img src="https://s-media-cache-ak0.pinimg.com/236x/f7/0a/f6/f70af6169bbe3f8346e64a25d54bafea.jpg" class="logo">
</div>
<div class="title-wrapper">
<div class="log-shellHeaderTitle">Dashboard</div>
</div>
<div class="log-langButton">
<div id="log-LangButtSwitch">
<span class="log-switchHandle"></span>
<span class="log-switchLabels"></span>
</div>
</div>
<div class="avatar-wrapper">
<img class="avatar" src="https://www.talentenportaalhellendoorn.nl/thumbnails/man.png">
<div class="log-toolContainer">
<div class="log-popover">
Profile
Log out
</div>
</div>
</div>
</div>
</div>
Remove overflow hidden from #shell-header...
body {
background-color: #36a4b0;
}
#shell-header {
display: flex;
height: 46px;
overflow: visible;
z-index: 3;
opacity: 1;
white-space: nowrap;
}
.logo-wrapper {
padding-left: 56px;
}
#media (max-width: 480px) {
.logo-wrapper {
padding-left: 1rem;
}
}
.title-wrapper {
left: 0;
right: 0;
text-align: right;
flex-grow: 1;
}
.avatar-wrapper {
padding-right: 56px;
position: relative;
}
#media (max-width: 480px) {
.avatar-wrapper {
padding-right: 1rem;
}
}
.logo {
height: 30px;
line-height: 40px;
max-width: 96px;
margin-top: 0.35rem;
}
.log-shellHeaderTitle {
font-size: 20px;
line-height: 36px;
color: #fff;
text-overflow: ellipsis;
text-align: center;
display: block;
white-space: nowrap;
overflow: hidden;
font-weight: inherit;
margin-left: 0px;
margin-top: 0px;
margin-bottom: 0px;
text-shadow: 0 1px rgba(255, 255, 255, 0.5);
}
.log-langButton {
padding-right: 40px;
}
#media only screen and (max-width: 480px) {
.log-langButton {
padding-right: 10px;
}
}
#log-LangButtSwitch {
background: transparent;
cursor: pointer;
display: block;
position: relative;
float: left;
width: 40px;
padding: 2px;
margin-top: 0.25rem;
border: 2px solid #fff;
border-radius: 28px;
}
.log-switchHandle {
display: block;
background: #fff;
height: 20px;
width: 20px;
z-index: 9999;
border-radius: 20px;
}
.log-switchLabels {
position: absolute;
top: 5px;
z-index: -1;
width: 100%;
font-family: Helvetica, sans-serif;
font-weight: bold;
color: #fff;
text-transform: uppercase;
text-shadow: 0 1px rgba(255, 255, 255, 0.5);
}
.log-switchLabels:before {
content: "EN";
position: absolute;
left: 21px;
font-size: 12px;
}
.log-switchLabels:after {
content: "DE";
position: absolute;
right: 26px;
font-size: 12px;
}
.fa-user-o:before {
font-size: 1.375rem;
color: #fff;
}
.avatar {
text-align: center;
margin-top: 0.35rem;
width: 25px;
}
.log-popover {
visibility: visible;
z-index: 460;
display: block;
overflow: visible;
top: 121px;
left: 375.063px;
bottom: 10px;
transition: opacity 0.2s linear;
color: #333333;
min-width: 100px;
box-sizing: border-box;
outline: none;
max-width: 100%;
max-height: 84px;
min-height: 2rem;
overflow: hidden;
background: #ffffff;
border: none;
box-shadow: 0 0.625rem 1.875rem 0 rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.15);
border-radius: 0.25rem;
}
.log-popover a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.log-popover a:hover {
background-color: #f0f0f0;
}
.log-popover a:active,
.log-popover a:focus {
background: #e8eff6;
outline: 1px dotted #000000;
outline-offset: -2px;
}
.log-popover:after,
.log-popover:before {
bottom: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.log-popover:after {
border-color: rgba(255, 255, 255, 0);
border-bottom-color: #fff;
border-width: 10px;
margin-left: -10px;
}
.log-popover:before {
border-color: rgba(51, 51, 51, 0);
border-bottom-color: #333333;
border-width: 11px;
margin-left: -11px;
}
.log-toolContainer {
position: absolute;
height: 100%;
width: 100%;
}
<div class="log-container">
<div id="shell-header">
<div class="logo-wrapper">
<img src="https://s-media-cache-ak0.pinimg.com/236x/f7/0a/f6/f70af6169bbe3f8346e64a25d54bafea.jpg" class="logo">
</div>
<div class="title-wrapper">
<div class="log-shellHeaderTitle">Dashboard</div>
</div>
<div class="log-langButton">
<div id="log-LangButtSwitch">
<span class="log-switchHandle"></span>
<span class="log-switchLabels"></span>
</div>
</div>
<div class="avatar-wrapper">
<img class="avatar" src="https://www.talentenportaalhellendoorn.nl/thumbnails/man.png">
<div class="log-toolContainer">
<div class="log-popover">
Profile
Log out
</div>
</div>
</div>
</div>
</div>
Please refer to this image as a visual aid for my question.
I want the text input with "Sindre", the other input, and the buttons, to be placed higher, so they vertically align with the Icehotel logo. How can I do this?
Here's my code...
HTML
<div id="header-content">
<br>
<a href="/index">
<img draggable="false" src="{url}/app/tpl/skins/{skin}/images/logo.gif" style="position:relative; margin-left: 20px; <div align=; color: #FA0000;margin-top: 15px;margin-left: 180px">
</a>
<input id="username" name="log_username" placeholder="Username" style="position:relative; margin-left: 20px;padding:5px;box-shadow:3px 3px 5px black;border: 0;width:250px;background: #3b8ba4;border-radius: 6px;color: #baedf5;" type="text">
<input id="password" name="log_password" placeholder="Password" style="position:relative;margin-left: 1px;padding:5px;box-shadow:3px 3px 5px black;border: 0;width:250px;background: #3b8ba4;border-radius: 6px;color: #baedf5;" type="password">
<a href="{url}/api.php">
<button class="login green" name="login" style="height:34px;" type="submit">Let's go!</button>
</a>
<a>
<button class="login red" style="height:34px; margin-left: 4px" type="sumbit">Forgot your password?</button>
</a>
</div>
CSS
pre, blockquote {
border: 1px solid #999;
page-break-inside: avoid
}
thead {
display: table-header-group
}
tr, img {
page-break-inside: avoid
}
img {
max-width: 100%!important
}
#page {
margin: .5cm
}
p, h2, h3 {
orphans: 3;
widows: 3
}
h2, h3 {
page-break-after: avoid
}
}
html {
height: 100%
}
body {
height: 100%;
margin: 0;
padding: 0;
color: #e0eff5;
background-attachment: fixed;
background-color: #013448;
background-image: url('http://localhost/app/tpl/skins/aura/habboweb/planet.png');
background-image: url('http://localhost/app/tpl/skins/aura/habboweb/planet.png'), -webkit-radial-gradient(190px 190px, circle farthest-side, #0297c8 0, #013448 480px);
background-image: url('http://localhost/app/tpl/skins/aura/habboweb/planet.png'), -moz-radial-gradient(190px 190px, circle farthest-side, #0297c8 0, #2D3877 480px);
, -ms-radial-gradient(190px 190px, circle farthest-side, #0297c8 0, #013448 480px);
, radial-gradient(circle farthest-side at 190px 190px, #0297c8 0, #013448 480px);
min-height: 755px
}
i, cite, em, var, address, dfn {
font-style: italic;
}
body {
font-family: "Ubuntu Condensed", Arial, serif;
font-weight: normal;
min-height: 0;
}
#footer a {
color: #a1b5c8;
text-decoration: none;
font-size: 13px;
}
body {
font-size: 1em;
line-height: 1.4;
}
.form__input, .form__select {
box-shadow: inset 0 2px 0 0 #9ebecc;
line-height: 1.2;
padding: 5px 12px;
width: 100%;
font-size: 16px;
}
.button b, .new-button i {
position: absolute;
display: block;
left: 2px;
top: 3px;
right: 2px;
height: 9px;
background-color: #4a9fb4;
z-index: 0
}
.button:hover, .new-button:hover {
background-color: #418491
}
.button:hover b, .new-button:hover i {
background-color: #46a9bf
}
.button span, .new-button b {
position: relative;
z-index: 100
}
.button:active, .button-active, .new-button:active {
left: 1px;
top: 1px;
box-shadow: 2px 2px rgba(0, 0, 0, 0.4)
}
.button.dimmed {
-ms-filter: "alpha(opacity=50)";
filter: alpha(opacity=50);
-moz-opacity: .5;
opacity: .50
}
.button.large {
height: 100px;
background-color: #c78800;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid #5f4416
}
.button.large:hover {
background-color: #d99b00
}
.button.large:hover b {
background-color: #f7ce00
}
.button.large b {
left: 4px;
top: 4px;
right: 4px;
height: 48px;
background-color: #f0bb00;
-webkit-border-radius: 2px 2px 0 0;
-moz-border-radius: 2px 2px 0 0;
border-radius: 2px 2px 0 0
}
.button.large span {
display: block;
font-size: 27px;
font-weight: bold;
text-transform: uppercase;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
line-height: 54px
}
.button.large span.sub {
display: block;
font-size: 17px;
font-weight: bold;
line-height: 42px;
text-transform: none
}
.button.large.not-so-large {
height: 48px
}
.button.large.not-so-large b {
height: 20px
}
.button.large.not-so-large span {
text-transform: none;
font-size: 22px;
line-height: 46px
}
header, footer {
width: 100%;
background: #101016;
background: rgba(16, 16, 22, 0.85);
position: fixed;
z-index: 999
}
#login-errors {
width: 100%;
height: 35px;
background-color: #c00;
color: #fff;
font-size: 17px;
font-weight: bold;
text-align: center;
line-height: 35px
}
#login-errors a {
color: #000
}
#footer-content {
float: left;
margin-left: 50px
}
#footer-content.partner-logo-present {
margin-left: 20px
}
#footer {
width: 100%;
min-width: 780px;
margin-top: 19px
}
header {
top: 0;
min-height: 99px
}
header #border-left {
position: absolute;
width: 500px;
height: 1px;
left: 0;
bottom: 0;
border-bottom: 1px solid #7aa3b9
}
header #border-right {
position: absolute;
width: 100%;
height: 1px;
left: 220px;
bottom: 0;
border-bottom: 1px solid #7aa3b9
}
footer {
height: 69px;
bottom: 0;
border-top: 1px solid #7aa3b9
}
#top-bar-triangle, #top-bar-triangle-border {
position: absolute;
left: 163px;
bottom: -29px
}
#top-bar-triangle {
font-size: 0;
height: 0;
line-height: 0;
border-style: solid;
float: left;
margin: 0;
border-color: #101016 transparent;
border-color: rgba(16, 16, 22, 0.85) transparent;
border-width: 29px 29px 0 29px
}
#top-bar-triangle-border {
background-image: url('http://localhost/images/new_index/images/v3/top_bar_arrow_border.out.png');
width: 58px;
height: 29px
}
header #habbo-logo {
position: absolute;
width: 190px;
height: 52px;
background-image: url('http://localhost/app/tpl/skins/aura/images/logo.png');
left: 32px;
top: 27px
}
#login-form-container {
position: relative
}
header form {
position: relative;
left: 239px;
top: 0;
width: 740px;
height: 99px
}
#login-columns {
position: relative
}
header form.captcha {
height: 200px
}
header form.captcha #login-recaptcha {
height: 103px;
margin-top: 8px
}
#login-recaptcha .field-error, #login-recaptcha #captcha-overlay {
display: none
}
#login-column-1 {
position: absolute;
left: 0;
top: 11px;
width: 205px;
height: 70px
}
#login-column-2 {
position: absolute;
left: 214px;
top: 11px;
width: 134px;
height: 70px
}
#login-column-3 {
position: absolute;
left: 358px;
top: 32px;
width: 205px;
height: 55px
}
Set vertical-align: middle; on the inputs and remove the margin-top from the inline styles in the logo <img> tag.
While I'm at this, though...General cleanup of this code is probably a good idea. I would like to caution you to avoid mixing inline styles and CSS. Also, the <br> tag should probably be replaced with padding - that line break and the inline styles are there only for design purposes and design is handled in CSS. Keeping as much design out of the HTML will help you (or someone else) easily make changes to this site later, if needed. The <img> tag's styles also include two margin-left values. I would remove one to avoid confusion. Lastly, I think you will want to remove <div align=; from the <img> tag's styles. As far as I know, this doesn't accomplish anything.
Hope that helps!