I've created This box, but i can't set it's content to stretch accordingly to it's height... once the view is stretched to height - the content is still fixed...and not spread evenly...I've tried to set padding with percentage to the LI - but it's not
working....is there a way to set it only with CSS?
.cont {
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: space-between;
}
.box {
width: 40vw;
height: 50vh;
}
.row_wrapper {
display: flex;
flex-direction: column;
background-color: grey;
border-radius: 5px;
overflow: hidden;
width: 100%;
height: 100%;
}
.flex-row {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
padding: 0px 0px 0px 0px;
margin: 0px;
}
.flex-outer {
width: 100%;
padding: 0px 0px 0px 0px;
margin: 0px;
}
.flex-row li {
width: 50%;
/* padding-right: 10px; */
}
.flex-outer li {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
padding-bottom: 5px;
}
.select {
width: 100%;
border-radius: 5px;
border: 1px solid #dcdcdc;
padding: 5%;
font-size: 0.7vw;
}
.parameters_btn {
border: none;
background-color: #49c8c1;
border-radius: 0.5vw;
font-size: 0.9vw;
padding: 1% 5% 2% 5%;
color: #fff;
outline: none;
width: 50%;
height: 20%;
}
.parameters_btn:hover {
background-color: #40afa9;
outline: none;
}
.parameters_btn:active {
background-color: #2d7c78;
outline: none;
}
.user_box_header {
background-color: #fff;
min-height: 20%;
align-items: center;
justify-content: start;
display: flex;
padding-left: 15px;
border-bottom: 1px solid #e9e9e9;
}
.user_box_header span {
font-size: 0.8vw;
color: #3f4760;
font-family: 'Montserrat Bold', sans-serif;
font-weight: 600;
}
.user_box_header i:before {
padding-right: 0.5vw;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-decoration: inherit;
color: #49c8c1;
font-size: 18px;
}
.user_notifications i:before {
content: "\f0a2";
}
.user_box_cont {
min-height: 80%;
padding: 5px 10px 5px 10px;
}
.material-switch {
width: 100%;
}
.material-switch>input[type="checkbox"] {
display: none;
}
.material-switch>label {
cursor: pointer;
height: 0px;
position: relative;
width: 40px;
}
.material-switch>input[type="checkbox"]+label::before {
content: "\f222";
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-decoration: inherit;
color: #333333;
text-align: right;
border: 1px solid #dcdcdc;
padding-left: 10px;
padding-right: 10px;
font-size: 1vw;
}
.material-switch>label::before {
background-color: #f6f6f6;
border-radius: 50px;
height: 2.5vh;
margin-top: -12px;
position: absolute;
width: 8vw;
}
.material-switch>label::after {
/*--button---*/
content: "";
font-size: 1vw;
background-color: #fff;
border-radius: 50px;
height: 2.5vh;
left: -4px;
margin-top: -8px;
position: absolute;
top: -4px;
width: 6vw;
border: 1px solid #dcdcdc;
}
.material-switch>input[type="checkbox"]:checked+label::before {
background-color: #f6f6f6;
content: "\f221";
font-family: FontAwesome;
text-align: left;
font-size: 1vw;
}
.material-switch>input[type="checkbox"]:checked+label::after {
background-color: #fff;
left: 30px;
}
.femme {
display: none;
}
.material-switch>input[type="checkbox"]:checked+label>span.homme {
display: none;
}
.material-switch>input[type="checkbox"]:checked+label>span.femme {
display: block;
top: -8px;
}
.homme,
.femme {
font-family: 'Roboto Light', sans-serif;
font-style: normal;
font-weight: normal;
text-decoration: inherit;
color: #5d5d5d;
font-size: 0.7vw;
position: absolute;
top: -10px;
z-index: 999;
}
.material-switch>input[type="checkbox"]:checked+label .homme,
.material-switch>input[type="checkbox"]:checked+label .femme {
left: 43px;
}
.homme::before {
content: "\f222";
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-decoration: inherit;
color: #49c8c1;
margin-right: 5px;
}
.femme::before {
content: "\f221";
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-decoration: inherit;
color: #49c8c1;
margin-right: 5px;
}
<div class="cont">
<div class="box">
<div class="row_wrapper">
<div class="user_box_header user_notifications"><i></i>
<p>NOTIFICATIONS</p>
</div>
<div class="user_box_cont">
<ul class="flex-outer">
<li>
<ul class="flex-row">
<li>
<p>Select 3</p>
<select class="params_select">
<option>822-0123-56789</option>
<option>822-0123-56789</option>
<option>822-0123-56789</option>
</select>
</li>
<li>
<p>Select 4</p>
<select class="params_select">
<option>Jean-Luc BÉNAZET</option>
<option>Jean-Luc BÉNAZET</option>
<option>Jean-Luc BÉNAZET</option>
</select>
</li>
</ul>
<li>
</li>
</ul>
<ul class="flex-outer">
<li>
<ul class="flex-row">
<li>
<p>Select 3</p>
<select class="params_select">
<option>822-0123-56789</option>
<option>822-0123-56789</option>
<option>822-0123-56789</option>
</select>
</li>
<li>
<p>Select 4</p>
<select class="params_select">
<option>Jean-Luc BÉNAZET</option>
<option>Jean-Luc BÉNAZET</option>
<option>Jean-Luc BÉNAZET</option>
</select>
</li>
</ul>
<li>
<button class="parameters_btn">
Send
</button>
</li>
</ul>
</div>
</div>
</div>
</div>
To fit the content in the div you must not set the height fixed, use height:auto; you can add max-height and max width, also min-width, min-height.
it's because of your row wrappers height is static ,change its style like code below
.row_wrapper {
display: flex;
flex-direction: column;
background-color: grey;
border-radius: 5px;
overflow: hidden;
width: 100%;
height: auto;
}
It might happen because of your .box height is statically 50vh. If you can change it to auto may give desired output.
Find updated fiddler here. Hope it helps.
Related
I am attempting to create a contact form for my online store and I ran into a bug, when I try to type inside my text fields the website won't allow me to do so.
I have tried a couple of things but they were not much help. I have yet to add any JavaScript but I am not sure if that is the root of my problem or if it's something simple.
* {
margin: 0;
padding: 0;
font-family: 'poppins', sans-serif;
box-sizing: border-box;
}
.hero {
background: #1d2026;
min-height: 100vh;
width: 100%;
color: #fff;
position: relative;
}
nav {
display: flex;
align-items: center;
}
nav .menu {
width: 50px;
margin-right: 20px;
cursor: pointer;
padding-bottom: 50px;
}
nav .logo {
width: 500px;
height: 200px;
object-fit: none;
padding-right: 80px;
padding-bottom: 55px;
}
nav ul {
flex: 1;
text-align: right;
margin-right: 20px
}
nav ul li {
display: inline-block;
list-style: none;
margin-right: 20px;
padding-bottom: 100px;
font-size: 25px;
margin: 0 20px;
}
nav ul a {
text-decoration: none;
color: #fff;
}
.lamp-set {
position: absolute;
top: -20px;
left: 22%;
width: 200px;
}
.lamp {
width: 100%;
}
.light {
position: absolute;
top: 97%;
left: 50%;
transform: translateX(-50%);
width: 700px;
margin-left: -10px;
opacity: 1;
}
.text-container {
max-width: 1000px;
margin-top: 2%;
margin-left: 50%;
}
.text-container h1 {
font-size: 80px;
font-weight: 400;
display: inline-block;
color: #fff;
}
.text-container p {
font-size: 40px;
font-weight: 200;
display: inline-block;
color: #fff;
margin-top: 10px;
}
.emails {
background: #00a8f3;
padding: 14px 40px;
display: inline-block;
color: #fff;
font-size: 25px;
margin-top: 30px;
margin-left: 50%;
border-radius: 30px;
}
.villian {
background: #1d2026;
min-height: 100vh;
width: 100%;
color: #fff;
position: relative;
}
.text-contact {
max-width: 1000px;
margin-top: 2%;
margin-left: 50%;
}
.text-contact h1 {
font-size: 50px;
font-weight: 400;
display: inline-block;
color: #fff;
}
.text-shop h1 {
font-size: 80px;
font-weight: 400;
display: inline-block;
color: #fff;
margin-left: 50%;
}
.text-contact p {
font-size: 40px;
font-weight: 200;
display: inline-block;
color: #fff;
margin-top: 10px;
}
.container {
display: flex;
align-items: center;
justify-content: center;
}
form {
background: #fff;
display: flex;
flex-direction: column;
padding: 2vw 4vw;
width: 90%;
max-width: 600px;
border-radius: 10px;
}
form h3 {
color: #555;
font-weight: 800;
margin-bottom: 20px;
text-decoration: none;
}
form input,
form textarea {
border: 0;
margin: 10px 0;
padding: 20px;
outline: none;
background: #f5f5f5;
font-size: 16px;
}
form button {
padding: 15px;
background: #00a8f3;
color: #fff;
font-size: 18px;
border: 0;
outline: none;
cursor: pointer;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
<div class="hero">
<nav>
<img src="menu.png" class="menu">
<img src="ovlogo.png" class="logo">
<ul>
<li><a href="index.html">Home</li>
<li><a href="contact.html">contact</li>
</ul>
</nav>
<div class="container">
<form>
<h3>Get in touch</h3>
<input type="text" id="name" placeholder="Your name" required>
<input type="email" id="email" placeholder="Email" required>
<input type="text" id="phone" placeholder="Phone number" required>
<textarea id="message" rows="4" placeholder="How can we assist you?"></textarea>
<button type="submit">Submit</button>
</form>
</div>
</div>
You forgot to close your a tag so the whole page was a link which means if you click on anything contained in that link (virtually everything below the tag), it will reload the page
Fix is to add </a> to close it.
contact
* {
margin: 0;
padding: 0;
font-family: 'poppins', sans-serif;
box-sizing: border-box;
}
.hero {
background: #1d2026;
min-height: 100vh;
width: 100%;
color: #fff;
position: relative;
}
nav {
display: flex;
align-items: center;
}
nav .menu {
width: 50px;
margin-right: 20px;
cursor: pointer;
padding-bottom: 50px;
}
nav .logo {
width: 500px;
height: 200px;
object-fit: none;
padding-right: 80px;
padding-bottom: 55px;
}
nav ul {
flex: 1;
text-align: right;
margin-right: 20px
}
nav ul li {
display: inline-block;
list-style: none;
margin-right: 20px;
padding-bottom: 100px;
font-size: 25px;
margin: 0 20px;
}
nav ul a {
text-decoration: none;
color: #fff;
}
.lamp-set {
position: absolute;
top: -20px;
left: 22%;
width: 200px;
}
.lamp {
width: 100%;
}
.light {
position: absolute;
top: 97%;
left: 50%;
transform: translateX(-50%);
width: 700px;
margin-left: -10px;
opacity: 1;
}
.text-container {
max-width: 1000px;
margin-top: 2%;
margin-left: 50%;
}
.text-container h1 {
font-size: 80px;
font-weight: 400;
display: inline-block;
color: #fff;
}
.text-container p {
font-size: 40px;
font-weight: 200;
display: inline-block;
color: #fff;
margin-top: 10px;
}
.emails {
background: #00a8f3;
padding: 14px 40px;
display: inline-block;
color: #fff;
font-size: 25px;
margin-top: 30px;
margin-left: 50%;
border-radius: 30px;
}
.villian {
background: #1d2026;
min-height: 100vh;
width: 100%;
color: #fff;
position: relative;
}
.text-contact {
max-width: 1000px;
margin-top: 2%;
margin-left: 50%;
}
.text-contact h1 {
font-size: 50px;
font-weight: 400;
display: inline-block;
color: #fff;
}
.text-shop h1 {
font-size: 80px;
font-weight: 400;
display: inline-block;
color: #fff;
margin-left: 50%;
}
.text-contact p {
font-size: 40px;
font-weight: 200;
display: inline-block;
color: #fff;
margin-top: 10px;
}
.container {
display: flex;
align-items: center;
justify-content: center;
}
form {
background: #fff;
display: flex;
flex-direction: column;
padding: 2vw 4vw;
width: 90%;
max-width: 600px;
border-radius: 10px;
}
form h3 {
color: #555;
font-weight: 800;
margin-bottom: 20px;
text-decoration: none;
}
form input,
form textarea {
border: 0;
margin: 10px 0;
padding: 20px;
outline: none;
background: #f5f5f5;
font-size: 16px;
}
form button {
padding: 15px;
background: #00a8f3;
color: #fff;
font-size: 18px;
border: 0;
outline: none;
cursor: pointer;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
<div class="hero">
<nav>
<img src="menu.png" class="menu">
<img src="ovlogo.png" class="logo">
<ul>
<li><a href="index.html">Home</li>
<li>contact</li>
</ul>
</nav>
<div class="container">
<form>
<h3>Get in touch</h3>
<input type="text" id="name" placeholder="Your name" required>
<input type="email" id="email" placeholder="Email" required>
<input type="text" id="phone" placeholder="Phone number" required>
<textarea id="message" rows="4" placeholder="How can we assist you?"></textarea>
<button type="submit">Submit</button>
</form>
</div>
</div>
I am trying to move this form but it keeps 'hitting' the h3 tag and the button. I want to move them around without them interfering with one another.
I am talking about the gray panel:
Even when resizing the window, they interact and push one another.
I have tried using margin and padding, but that doesn't seem to work.
.section-3 {
position: relative;
background-color: white;
height: 600px;
top: 959px;
text-align: center;
}
.join-btn {
height: 45px;
font-size: 16px;
text-transform: uppercase;
text-align: center;
border-radius: 2px;
padding: 9px 20px 7px;
color: #373f3d;
border: 2px solid rgba(55, 63, 61, 0.2);
}
.section-3 .heading_section_3 {
font-size: 20px;
position: absolute;
bottom: 70%;
}
.description {
position: absolute;
color: #6e6e6e;
padding-left: 200px;
padding-right: 200px;
}
.join-right-side {
overflow: auto;
background-color: #c9c8c8;
position: absolute;
height: 300px;
padding: 30px;
margin-left: 50%;
display: flex;
align-items: center;
justify-content: center;
width: 50%;
}
.Join-left-side {
overflow: auto;
position: absolute;
height: 300px;
padding: 30px;
background-color: #f5f5f1;
display: flex;
align-items: center;
justify-content: center;
width: 50%;
}
.text-join-left {
color: black;
text-align: center;
padding-left: 200px;
padding-right: 200px;
}
.form {
height: fit-content;
overflow: hidden;
}
input[type="email"] {
border-color: black;
border-width: 2px;
background-color: #c9c8c8;
box-sizing: border-box;
list-style: none;
direction: ltr;
box-sizing: border-box;
padding: 0;
margin: 200px 200px 0px 0px;
display: block;
width: 100%;
appearance: none;
background: none;
border: none;
color: #373f3d;
font-family: GT Pressura Mono, Roboto Mono, monospace;
font-size: 28px;
line-height: 28px;
font-weight: 400;
}
<div class="section-3">
<div class="join-right-side">
<div class="join-btn">Join</div>
<h3 class="text-join-left">Sign up and get 10% off your first purchase.</h3>
<form class="form" action="/">
<input
class="input"
placeholder="Your email address..."
type="email"
name="EMAIL"
/>
</form>
</div>
<div class="join-left-side">
<h2 class="heading_section_3">Swallowtail Tea</h2>
<h3 class="description">
Swallowtail Tea is a Virginia-based tea company sourcing only the highest
quality tea, herbs, and spices from around the world.
</h3>
</div>
</div>
I think it could be linked to the way I'm accessing the div classes, or to the structure of the div's.
You can try:
CSS
.section-3 {
display:flex;
justify-content: space-between;
}
.join-left-side , .join-right-side {
width : 50%;
height: 300px;
}
.section-3 {
position: relative;
background-color: white;
height: 600px;
top: 959px;
text-align: center;
}
.join-btn {
height: 45px;
font-size: 16px;
text-transform: uppercase;
text-align: center;
border-radius: 2px;
padding: 9px 20px 7px;
color: #373f3d;
border: 2px solid rgba(55, 63, 61, .2);
}
.section-3 .heading_section_3 {
font-size: 20px;
}
.description {
color: #6e6e6e;
}
.join-right-side {
background-color: #c9c8c8;
height: 300px;
padding: 30px;
display: flex;
align-items: center;
justify-content: center;
width: 50%;
}
.join-left-side {
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
}
.form{
height: fit-content;
overflow: hidden;
}
input[type=email] {
border-color: black;
border-width: 2px;
background-color: #c9c8c8;
box-sizing: border-box;
list-style: none;
direction: ltr;
box-sizing: border-box;
padding: 0;
margin: 200px 200px 0px 0px;
display: block;
width: 100%;
appearance: none;
background: none;
border: none;
color: #373f3d;
font-family: GT Pressura Mono,Roboto Mono,monospace;
font-size: 28px;
line-height: 28px;
font-weight: 400;
}
HTML
<div class="section-3">
<div class="join-left-side">
<h2 class="heading_section_3">Swallowtail Tea</h2>
<h3 class="description">
Swallowtail Tea is a Virginia-based tea company sourcing only the highest
quality tea, herbs, and spices from around the world.
</h3>
</div>
<div class="join-right-side">
<div class="join-btn">Join</div>
<h3 class="text-join-left">Sign up and get 10% off your first purchase.</h3>
<form class="form" action="/">
<input
class="input"
placeholder="Your email address..."
type="email"
name="EMAIL"
/>
</form>
</div>
</div>
I use menu that was created by other developer in our company. I add to the first item of the menu dropdown selection, but the problem that the dropdown box not fully fill the all the item and I can't make it fill.
Here is HTML:
<div class="main-container-top-menu scroll1" id="main-container-top-menu">
<div class="top-menu-item-container-empty">
<div style="width: 50px"></div>
</div>
<div class="top-menu-item-container">
<div class="inactive-border-bottom">
<p class="control has-icons-left is-expanded">
<span class="select is-fullwidth ">
<select class="full-height">
<option>dropdown</option>
<option>options 1</option>
</select>
</span>
<span class="icon is-small is-left"><i class="far fa-building"></i></span>
</p>
</div>
</div>
<div class="top-menu-item-container" >
<div>
<div class="top-menu-item">2. Lot and Model</div>
</div>
</div>
<div class="top-menu-item-container" >
<div [className]="ishpExpanded?'active-border-bottom':'inactive-border-bottom'">
<div class="top-menu-item">3. Home Plan</div>
</div>
</div>
<div class="top-menu-item-container">
<div [className]="isupgExpanded?'active-border-bottom':'inactive-border-bottom'">
<div class="top-menu-item">4. Upgrades</div>
</div>
</div>
<div class="top-menu-item-container">
<div [className]="isnextExpanded?'active-border-bottom':'inactive-border-bottom'">
<div class="top-menu-item">5. Next Steps</div>
</div>
</div>
<div class="top-menu-icon-container">
<i class="fas fa-print top-menu-icon"></i>
<i class="fas fa-share-alt top-menu-icon"></i>
</div>
</div>
And here is CSS:
.scroll1::-webkit-scrollbar {
width: 0px;
height: 3px;
}
.scroll1::-webkit-scrollbar-track {
background: #eff0f0;
}
.scroll1::-webkit-scrollbar-thumb {
background: #666;
}
.main-container-top-menu {
scrollbar-width: auto;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.top-menu-item-container-empty {
border-bottom: 2px solid #eff0f0;
font-family: "Roboto", sans-serif;
border-right: 2px solid #eff0f0;
box-sizing: border-box;
color: #626262;
font-size: 14px;
font-weight: 350;
user-select: none;
justify-content: space-between;
}
.top-menu-item-container {
border-bottom: 2px solid #eff0f0;
font-family: "Roboto", sans-serif;
border-right: 2px solid #eff0f0;
box-sizing: border-box;
color: #626262;
font-size: 14px;
font-weight: 350;
user-select: none;
flex: 1;
justify-content: space-between;
}
.active-border-bottom {
align-items: center;
display: flex;
padding-left: 20px;
padding-right: 20px;
height: 100%;
border-bottom: 3px solid #eb2028;
box-sizing: border-box;
}
.inactive-border-bottom {
align-items: center;
display: flex;
padding-left: 20px;
padding-right: 20px;
height: 100%;
}
.top-menu-item-active {
cursor: pointer;
font-family: "Roboto", sans-serif;
padding: 5px;
font-family: "Roboto", sans-serif;
box-sizing: border-box;
color: #1d1d1d;
font-size: 14px;
font-weight: 350;
user-select: none;
align-items: center;
justify-content: center;
display: flex;
stroke-width: 0.6px;
-webkit-text-stroke-width: 0.6px;
flex: 1;
}
.top-menu-item {
cursor: pointer;
padding: 10px;
font-family: "Roboto", sans-serif;
box-sizing: border-box;
color: #626262;
font-size: 14px;
user-select: none;
align-items: center;
justify-content: center;
display: flex;
flex: 1;
}
.top-menu-item-first {
cursor: default;
border-right: 2px solid #eff0f0;
font-size: 14px;
padding-right: 20px;
font-weight: 800;
border-bottom: 2px solid #eff0f0;
border-left: none;
text-align: left;
justify-content: left;
flex: 1;
}
.top-right-menu-item {
/* margin-right: 50px; */
border-bottom: 2px solid #eff0f0;
height: 100%;
display: inline-flex;
justify-content: flex-end;
align-items: center;
}
.top-item-logo {
height: 55px;
z-index: 100;
width: 55px;
object-fit: contain;
}
.top-menu-icon-container{
display: flex;
align-items: center;
justify-content: center;
}
.top-menu-icon {
cursor: pointer;
margin-right: 25px;
margin-left: 25px;
cursor: pointer;
width: 14px;
padding-top: 25px;
padding-bottom: 25px;
}
.left-arrow,
.right-arrow {
display: none;
}
#media screen and (max-width: 768px) {
.constructor-top-container {
justify-content: center;
padding-left: 3%;
}
}
#media screen and (max-width: 1088px) {
.top-right-menu-item {
padding-left: 10px;
margin-right: 0px;
border-bottom: 2px solid #eff0f0;
flex: 1;
height: 100%;
display: inline-flex;
justify-content: flex-end;
align-items: center;
}
.main-container-top-menu {
padding-left: 0;
padding-right: 0;
padding-bottom: 3px;
}
}
#media screen and (max-width: 414px) {
.top-menu-icon {
margin-right: 15px;
cursor: pointer;
width: 14px;
padding-top: 12px;
}
.scroll1::-webkit-scrollbar {
width: 0px;
height: 0px;
}
.scroll1::-webkit-scrollbar-track {
background: #eff0f0;
}
.scroll1::-webkit-scrollbar-thumb {
background: #666;
}
.top-menu-item-first {
padding-left: 35px;
}
.main-container-top-menu {
transition: 0.2s all;
min-height: 62px;
}
.top-item-logo {
position: absolute;
top: 0;
right: 0px;
margin: 0;
padding: 0;
z-index: 100;
height: 62px;
width: 62px;
object-fit: contain;
}
.left-arrow {
height: 60px;
padding-left: 5px;
padding-right: 5px;
background: white;
display: flex;
align-items: center;
position: absolute;
cursor: pointer;
color: #d1d1d1;
top: 0px;
font-size: 1.6rem;
left: 0;
z-index: 5;
padding-left: 7px;
}
.right-arrow {
height: 60px;
padding-left: 5px;
padding-right: 5px;
background: white;
display: flex;
align-items: center;
position: absolute;
cursor: pointer;
color: #b1b1b1;
font-size: 1.6rem;
left: calc(100% - 88px);
}
}
#media screen and (max-width: 1088px) {
.main-container-top-menu {
overflow-x: auto;
overflow-y: hidden;
/* display: block; */
width: 100%;
white-space: nowrap !important;
}
}
#media screen and (max-width: 414px) {
.main-container {
padding-left: 0px;
padding-right: 0px;
}
}
.no-suite-title {
text-transform: uppercase;
font-size: 1.3em;
font-weight: 300;
position: absolute;
left: 10%;
top: 50%;
z-index: 1000;
}
Workink jsFiddle!
How can I make dropdown to fill the menuc without gaps?
Update
Text moved to the left:
To get the desired result, you need to do the following:
Remove padding-left: 20px and padding-right: 20px from the .inactive-border-bottom selector;
Add height: 100% to these selectors - .control and .select.is-fullwidth.
Need to register .full-height in your css, and write the rule height: 100%!important in it. !important is necessary because this rule overrides the height: 2.5em rule in the .select select.
I have a site and it has 2 sections. the left section is a navigation bar with menus below.
The section next to it is the main section or where the website content must be placed. My problem is the right section is positioned a few pixels from the header. How can i fix this? I provided some image to let you see how the website should look like.
/*WRITTEN USING SASS*/
#side-menu{
margin-top: 25px;
.side-menu-bg {
width: max-content;
h3 {
position: absolute;
color: white;
padding: 0px 18px;
font-size: 27px;
}
img {
display: -webkit-box;
}
}
.side-nav-bar {
width: 210px;
position: unset;
margin-top: -3px;
display: inline-flex;
z-index: 1;
flex-direction: column;
overflow-x: hidden;
background-color: #ffffff;
a {
display: inherit;
color: #707070;
text-decoration: none;
font-size: 15px;
padding: 10px 18px;
position: relative;
border-bottom: 1px solid #e8e8e8;
}
.active-link{
color: #a40022;
border-bottom: 2px solid #8a001c;
}
}
.right-contents {
float: right;
.title h3 {
font-size: 38px;
}
.body-content {
background-color: #d3d3d3;
height: 1094px;
width: 738px;
}
}
}
<div class="wrapper"> <!--to make contents center-->
<div id="side-menu">
<div class="side-menu-bg">
<h3>KU 스타트업</h3>
<img src="images/bg/bg_03.png">
</div>
<div class="side-nav-bar">
인사말
창업 비전
창업 프로세스
창업부서소개
찾아오시는 길
</div>
<div class="right-contents">
<div class="title">
<h3>인사말</h3>
<div class="body-content">
sample text
</div>
</div>
</div>
</div>
</div>
Add margin: 0 to your h3 tag.. h3 has margin-to and margin-bottom by default. thanks
.right-contents {
float: right;
.title h3 {
font-size: 38px;
margin: 0; /*add this*/
}
.body-content {
background-color: #d3d3d3;
height: 1094px;
width: 738px;
}
<style>
/*WRITTEN USING SASS*/
#side-menu{
margin-top: 25px;
.side-menu-bg {
width: max-content;
h3 {
position: absolute;
color: white;
padding: 0px 18px;
font-size: 27px;
}
img {
display: -webkit-box;
}
}
.side-nav-bar {
width: 210px;
position: unset;
margin-top: -3px;
display: inline-flex;
z-index: 1;
flex-direction: column;
overflow-x: hidden;
background-color: #ffffff;
}
a {
display: inherit;
color: #707070;
text-decoration: none;
font-size: 15px;
padding: 10px 18px;
position: relative;
border-bottom: 1px solid #e8e8e8;
}
.active-link{
color: #a40022;
border-bottom: 2px solid #8a001c;
}
}
.right-contents {
width: 65%;
margin-top: -3px;
display: inline-flex;
.title h3 {
font-size: 38px;
}
.body-content {
background-color: #d3d3d3;
height: 1094px;
width: 738px;
}
</style>
I received help centering an image within a box using a "helper" pseudo element element, which was working until I published it live. I'm not sure what's going on.
you can see whats going on at live link. And this is the code I was using for the layout
Code:
.offer {
width: 288px;
float: left;
margin-right: 25px;
}
.box {
position: relative;
display: block;
border: solid 3px #19468d;
height: 310px;
width: 100%;
margin-top: 11px;
text-align: center;
}
.price span {
font-family: avenir next;
font-weight: 700;
background-color: #19468d;
color: white;
font-size: 21px;
padding: 0px 5px;
left: 0;
padding-left: 0;
}
.price a {
position: relative;
font-family: avenir next;
font-weight: 700;
background-color: #19468d;
color: white;
font-size: 21px;
padding: 1px 7px;
left: 3px;
bottom: 1px;
border-style: solid;
border-color: #19468d;
}
.price a:hover {
color: #19468d;
background-color: white;
border-style: solid;
}
#cost {
position: absolute;
left: 0px
}
#info {
position: absolute;
bottom: 0px;
right: 0px
}
.box img {
display: inline-block;
margin: 0 auto;
text-align: center;
max-width: 252px;
vertical-align: center;
}
#grid {
margin: 0px;
display: flex;
display: -webkit-flex;
/* Safari 8 */
flex-wrap: wrap;
-webkit-flex-wrap: wrap;
/* Safari 8 */
-webkit-justify-content: center;
/* Safari 8 */
margin-left: 20px;
}
.helper {
display: inline-block;
height: 100%;
vertical-align: middle;
}
.price {
text-align: left
}
.price #dollar {
padding-right: 0px;
padding-left: 5px;
}
<div class="offer">
<div class="box">
<div class="price">
<span id="dollar">$</span><span>27</span>
</div>
<span class="helper"></span>
<img src="http://cdn2.hubspot.net/hubfs/75704/JPs-Slices/2016_Yes/img/floorexammat.jpg">
<div class="price" id="info">
Buy Now
</div>
</div>
Rather use flex for the images. On the ".box" you can do
display:flex;
justify-content: center;
and remove the helper.