I'm designing this box but I have the following problem. I have an image, a header and some text inside of it but I can't align the header so that it appears above the rest of the text. It ends up looking like this:
HTML:
<div class='Favorites'>
<div class='favorites_info'>
<div class="box">
<div class="picture">
<img src="Iconos/Help/favorites_help.png" alt="Fav" class="favor_help">
</div>
<div class="Messagebox_title">
<h1 >Favorites category
</h1>
</div>
<div class="Messagebox">
<h4 >You can select devices as favorites so you can get access to them quicklier. Devices marked as favorites will be displayed in the "Favorites" category under the "Devices" tab.
</h4>
</div>
</div>
</div>
CSS regarding the two text parts:
.Messagebox_title {
vertical-align:middle;
display:table-cell;
text-align:center;
color: #555;
position: relative;
font-family: monaco, monospace;
font-size: 15px;
}
.Messagebox {
vertical-align:middle;
display:table-cell;
text-align:justify;
color: #555;
position: relative;
margin-left: 2px;
margin-right: 2px;
margin-top: 0px;
margin-bottom: 0px;
font-family: monaco, monospace;
font-size: 15px;
}
You could use flexbox, you would need to wrap the text in an additional div.
Example:
.Messagebox_title {
text-align: center;
}
.Messagebox {
text-align: justify;
margin: 0 2px;
}
.box {
font-size: 15px;
font-family: monaco, monospace;
display: flex;
color: #555;
}
.text_wrapper {
display: flex;
flex-direction: column;
}
<div class='Favorites'>
<div class='favorites_info'>
<div class="box">
<div class="picture">
<img src="https://unsplash.it/150" alt="Fav" class="favor_help">
</div>
<div class="text_wrapper">
<div class="Messagebox_title">
<h1>Favorites category
</h1>
</div>
<div class="Messagebox">
<h4>You can select devices as favorites so you can get access to them quicklier. Devices marked as favorites will be displayed in the "Favorites" category under the "Devices" tab.
</h4>
</div>
</div>
</div>
</div>
You can also do something similar with CSS Grid, which reduces the amount of HTML needed.
.Favorites {
display: grid;
grid-template-columns: 150px 1fr;
grid-gap: 1em;
font-size: 15px;
font-family: monaco, monospace;
color: #555;
}
.picture {
grid-row: 1 / 3;
}
h1 {
grid-column: 2;
text-align: center;
}
h4{
grid-column: 2;
grid-row: 2;
text-align: justify;
margin: 0 2px;
}
<div class='Favorites'>
<div class="picture">
<img src="https://unsplash.it/150" alt="Fav" class="favor_help">
</div>
<h1>Favorites category</h1>
<h4>You can select devices as favorites so you can get access to them quicklier. Devices marked as favorites will be displayed in the "Favorites" category under the "Devices" tab.</h4>
</div>
Try changing according to your need
.box{float:left;width:100%;position:relative;border:1px solid yellow;margin-bottom:15px;}
info{border:1px solid blue;}
.icon{float:left;width:100px;background:yellow;height:120px;text-align:center;position:relative;overflow:hidden;}
.info .icon{background:blue;}
.icon span{position:absolute;top:auto;margin:33% auto;left:0;right:0;bottom:auto}
.text{float:left;width:calc(100% - 100px);width:-webkit-calc(100% - 200px);padding:5px;}
<div class="box">
<div class="icon"><span>Img</span></div>
<div class="text">
<h3>Heading comes here</h3>
<p>Lorem ipsum dolor sit amet, case discere concludaturque in mel, omnis aliquid offendit ut usu, ea minim partiendo vix</p></div>
</div>
<div class="box info">
<div class="icon"><span>img</span></div>
<div class="text">
<h3>Heading comes here</h3>
<p>Lorem ipsum dolor sit amet, case discere concludaturque in mel, omnis aliquid offendit ut usu, ea minim partiendo vix</p></div>
</div>
You are doing fine.
Your code works by making a small change.
Just change display: to block and add float: left to your picture.
<style>
.picture
{
float:left;
margin-right:10px;
}
.Messagebox_title {
vertical-align:middle;
display:block;
text-align:left;
color: #555;
position: relative;
font-family: monaco, monospace;
font-size: 15px;
}
.Messagebox {
vertical-align:middle;
display:block;
text-align:justify;
color: #555;
position: relative;
margin-left: 2px;
margin-right: 2px;
margin-top: 0px;
margin-bottom: 0px;
font-family: monaco, monospace;
font-size: 15px;
}
</style>
<div class='Favorites'>
<div class='favorites_info'>
<div class="box">
<div class="picture">
<img src="http://eztechtraining.com/wp-content/uploads/2012/11/2012-10-20-21.38.35-150x150.jpg" alt="Fav" class="favor_help">
</div>
<div class="Messagebox_title">
<h1 >Favorites category
</h1>
</div>
<div class="Messagebox">
<h4 >You can select devices as favorites so you can get access to them quicklier. Devices marked as favorites will be displayed in the "Favorites" category under the "Devices" tab.
</h4>
</div>
</div>
</div>
Related
This question already has answers here:
Position an element relative to its container
(5 answers)
CSS Positioning is not working as expected
(2 answers)
Media Queries: How to target desktop, tablet, and mobile?
(21 answers)
Position Relative vs Absolute?
(10 answers)
Closed 3 years ago.
So, I am using position:absolute to align elements on my website and it looks different on other resolutions. my current resolution is 1920x1080. I have another screen with 1366x768 resolution and it looks terrible on it. This is my first time of making proper website. Is there any other way to align elements to avoid this thing?
<html>
<head>
<style>
body{
background-color:gray;
overflow:hidden;
width:1366px;
height:768px;
}
.logo{
}
.mountain{
height:75px;
position:absolute;
left:15%;
top: 2%;
}
.name{
font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", Charcoal, "Helvetica Inserat", "Bitstream Vera Sans Bold", "Arial Black", "sans serif"; font-size: 300%; font-style: normal; font-variant: normal; font-weight: 400; line-height: 26.4px;
position:absolute;
top: 0%;
left: 19.5%;
}
.navigation{
position:relative;
top: 6%;
left: 50%;
}
.f{
height:30px;
width: 30px;
border-style:solid;
border-radius: 70px;
border-width: 1.5px;
border-color: white;
top:0px;
position:absolute;
left:20%;
}
.t{
height:30px;
width: 30px;
border-style:solid;
border-radius: 70px;
border-width: 1.5px;
border-color: white;
top:0px;
position:absolute;
left:23%;
}
.g{
height:30px;
width: 30px;
border-style:solid;
border-radius: 70px;
border-width: 1.5px;
border-color: white;
top:0px;
position:absolute;
left:26%;
}
.social{
display:inline-flexbox;
position:relative;
top: 30px;
left:1000px;
}
.content{
font-family: monospace; font-size: 500%; font-style: normal; font-variant: normal; font-weight: 700; line-height: 26.4px;
color:white;
position:absolute;
top: 30%;
left: 37%;
}
.content1{
font-family: monospace; font-size: 110%; font-style: normal; font-variant: normal; font-weight: 700; line-height: 200%;
color:white;
position:absolute;
top: 43%;
left: 24%;
}
.button{
height:50px;
width:200px;
border-style: solid;
border-width: 2px;
border-radius: 70px;
border-color:white;
position:absolute;
top: 50%;
left: 42%;
}
</style>
</head>
<body>
<div class="whole">
<div class="logo">
<img class="mountain" src="img/mountain.png">
<p class="name" style="color:white;">EVEREST</p>
</div>
<div class="navigation">
Features
Services
Contact us
</div>
<div class="social">
<div class="f">
<img src="img/f.png" style="height:25px;">
</div>
<div class="t">
<img src="img/t.jpg" style="height:25px;">
</div>
<div class="g">
<img src="img/g.png" style="height:25px;">
</div>
</div>
<div class="content">
<p> Hello World. </p>
</div>
<div class="content1">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
</div>
<div class="button">
GET STARTED
</div>
</div>
</body>
</html>
this is what is looks like on 1366x768
You need to do a responsive website using Media queries of a framework like Bootstrap using a grid.
Here an example of Media queries:
#media (min-width: 30em) and (orientation: landscape) { ... }
Here an example of the grid Bootstrap displaying 3 equals columns independent of the screen size:
<div class="container">
<div class="row">
<div class="col-sm">
One of three columns
</div>
<div class="col-sm">
One of three columns
</div>
<div class="col-sm">
One of three columns
</div>
</div>
</div>
I want my first div "panel-1" to take the full width and height of screen.
I have been trying to break this problem from 3 days.
I tried height :100% & width:100 on parent. Then position:relative on section and position:absolute on div. I tried various other solutions on stack overflow. But none helped.
I created a fiddle at:-
https://jsfiddle.net/81uo3zfc/
<div id="navigation_panel">
<ul>
<li>Home</li>
<li>Technologies</li>
<li>Projects</li>
<li>Resources</li>
<li>Contact</li>
</ul>
</div>
<section>
<div id="panel-1">
<p class="lazyText">Hey!</p>
<p class="lazyText">Lorem ipsum dolor </p>
<p class="colorTransition">sit amet consectetur.</p>
<a class="nextBtn" id="nextBtn-1" href="#panel-2">Let's Go <img class="emoji" src="images/hand.svg" alt="Continue Icon"></a>
</div>
</section>
<section>
<div id="panel-2">
<p class="lazyText">Lorem ipsum</p>
<p class="normal lazyText"> dolor, sit amet </p>
<p class="normal">consectetur adipisicing elit. Voluptatum, a.</p>
<a class="nextBtn" id="nextBtn-2" href="#panel-3">Roger That <img class="emoji" src="images/hand.svg" alt="Continue Icon"></a>
</div>
</section>
<section>
<div id="panel-3">
<p class="lazyText">Lorem ipsum</p>
<p class="normal lazyText"> dolor, sit amet </p>
<p class="normal">consectetur adipisicing elit. Voluptatum, a.</p>
<a class="nextBtn" name="nextBtn-3" data="tech" href="javascript:;">Tech Person <img class="emoji" src="images/tech.svg" alt="Tech Icon"></a>
<a class="nextBtn" name="nextBtn-3" data="nontech" href="javascript:;" style="margin-left: 10px;">Non Tech Person <img class="emoji" src="images/non_tech.svg" alt="Non Tech Icon"></a>
</div>
</section>
Please help. I am new to CSS. And i really tried solving it on my own. But failed.
The Problem you ran into is, that the % sizes relate to the last offset parent (the body or the next relative/absolute/fixed element in the parent chain).
Since your offset parent is using the full screen height, elements using 100% will scale to that size too.
The way to go would be a flex layout.
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Set the flex layout to the parent element of the navigation, set the direction to column and size it to screen height. The navigation will remain static size by adding flex-grow:0; flex-shrink:0.
The content will be shown in a additional .content container, wich takes up the rest of the screen space using flex-grow:1;. The entries will will then be scaled to the height of the .content container using height:100%;.
The footer can also be part of this setup, by placing it in the .sizer container and set flex-grow:0; flex-shrink:0
html,body{
height: 100%;
margin:0;
}
.sizer {
display:flex;
flex-direction:column;
height: 100%;
}
.content {
flex-grow:1;
overflow: scroll;
}
#navigation_panel
{
background-color: #15598f;
padding: 2%;
margin: 0;
flex-shrink: 0;
flex-grow: 0;
}
#navigation_panel>ul
{
list-style-type: none;
padding: 0;
margin: 0;
}
#navigation_panel>ul>li
{
display: inline;
margin : 2%;
font-size: 20px;
font-family: 'Open Sans', sans-serif;
font-weight: 600;
}
#navigation_panel>ul>li>a{
text-decoration: none;
color: #ffffff;
}
section
{
width: 70%;
margin-left: auto;
margin-right: auto;
height: 90%;
height:100%;
padding: 20px 0;
box-sizing: border-box;
}
#panel-1,#panel-2,#panel-3,#panel-4,#panel-5,#panel-6
{
border: 4px solid #27a9e0;
position: relative;
padding: 4%;
height: 100%;
box-sizing: border-box;
}
#panel-1 p,#panel-2 p:nth-child(1),#panel-3 p:nth-child(1),#panel-4 p:nth-child(1),#panel-5 p:nth-child(1),#panel-6 p:nth-child(1)
{
font-size: 40px;
font-family: 'Open Sans', sans-serif;
font-weight: bolder;
}
.normal{
font-size: 24px;
font-family: 'Open Sans', sans-serif;
}
.normal-small{
font-size: 20px;
font-family: 'Open Sans', sans-serif;
}
.nextBtn
{
background-color: #15598f;
text-decoration: none;
padding: 20px;
font-family: 'Open Sans', sans-serif;
font-size: 20px;
color: #ffffff;
}
.emoji
{
width: 25px;
margin-left: 5px;
vertical-align: inherit;
transition: 0.5s;
}
.emoji:hover
{
transform: rotate(-30deg);
}
.AdditionalList>li>a
{
color : #1b8ab9;
border-bottom: 1px solid #27a9e066;
text-decoration: none;
margin: auto;
}
.AdditionalList>li
{
margin-bottom: 20px;
}
footer{
margin: 5% 2% 0% 0%;
}
.third{
width: 33%;
padding: 10px;
background-color: #242f4a;
color: #ffffff;
}
/*Technologies Css*/
.techlist>li{
font-size: 34px;
font-family: 'Open Sans', sans-serif;
}
<div class="sizer">
<div id="navigation_panel">
<ul>
<li>Home</li>
<li>Technologies</li>
<li>Projects</li>
<li>Resources</li>
<li>Contact</li>
</ul>
</div>
<div class="content">
<section>
<div id="panel-1">
<p class="lazyText">Hey!</p>
<p class="lazyText">Lorem ipsum dolor </p>
<p class="colorTransition">sit amet consectetur.</p>
<a class="nextBtn" id="nextBtn-1" href="#panel-2">Let's Go <img class="emoji" src="images/hand.svg" alt="Continue Icon"></a>
</div>
</section>
<section>
<div id="panel-2">
<p class="lazyText">Lorem ipsum</p>
<p class="normal lazyText"> dolor, sit amet </p>
<p class="normal">consectetur adipisicing elit. Voluptatum, a.</p>
<a class="nextBtn" id="nextBtn-2" href="#panel-3">Roger That <img class="emoji" src="images/hand.svg" alt="Continue Icon"></a>
</div>
</section>
<section>
<div id="panel-3">
<p class="lazyText">Lorem ipsum</p>
<p class="normal lazyText"> dolor, sit amet </p>
<p class="normal">consectetur adipisicing elit. Voluptatum, a.</p>
<a class="nextBtn" name="nextBtn-3" data="tech" href="javascript:;">Tech Person <img class="emoji" src="images/tech.svg" alt="Tech Icon"></a>
<a class="nextBtn" name="nextBtn-3" data="nontech" href="javascript:;" style="margin-left: 10px;">Non Tech Person <img class="emoji" src="images/non_tech.svg" alt="Non Tech Icon"></a>
</div>
</section>
</div>
</div>
You can use width: 100vw; and height: 100vh to exactly match the screen/viewport size.
Set this:
#panel-1{
width: 100vw;
height:100vh;
}
try this
**css**
html,body{
/*height: 100%;*/
margin:0;
/*border:1px solid black;*/
}
#navigation_panel
{
background-color: #15598f;
padding: 2%;
margin: 0;
}
#navigation_panel>ul
{
list-style-type: none;
padding: 0;
margin: 0;
}
#navigation_panel>ul>li
{
display: inline;
margin : 2%;
font-size: 20px;
font-family: 'Open Sans', sans-serif;
font-weight: 600;
}
#navigation_panel>ul>li>a{
text-decoration: none;
color: #ffffff;
}
section
{
width:100%;
margin-left: auto;
margin-right: auto;
margin-top: 2%;
margin-bottom: 40px;
height: 100%;
}
#panel-1,#panel-2,#panel-3,#panel-4,#panel-5,#panel-6
{
border: 4px solid #27a9e0;
position: relative;
padding: 4%;
height: 90%;
max-height: 600px !important;
}
#panel-1{
height: calc(100vh - 176px);
max-height: inherit !important;
}
#panel-1 p,#panel-2 p:nth-child(1),#panel-3 p:nth-child(1),#panel-4 p:nth-child(1),#panel-5 p:nth-child(1),#panel-6 p:nth-child(1)
{
font-size: 40px;
font-family: 'Open Sans', sans-serif;
font-weight: bolder;
}
.normal{
font-size: 24px;
font-family: 'Open Sans', sans-serif;
}
.normal-small{
font-size: 20px;
font-family: 'Open Sans', sans-serif;
}
.nextBtn
{
background-color: #15598f;
text-decoration: none;
padding: 20px;
font-family: 'Open Sans', sans-serif;
font-size: 20px;
color: #ffffff;
}
.emoji
{
width: 25px;
margin-left: 5px;
vertical-align: inherit;
transition: 0.5s;
}
.emoji:hover
{
transform: rotate(-30deg);
}
.AdditionalList>li>a
{
color : #1b8ab9;
border-bottom: 1px solid #27a9e066;
text-decoration: none;
margin: auto;
}
.AdditionalList>li
{
margin-bottom: 20px;
}
footer{
margin: 5% 2% 0% 0%;
}
.third{
width: 33%;
padding: 10px;
background-color: #242f4a;
color: #ffffff;
}
/*Technologies Css*/
.techlist>li{
font-size: 34px;
font-family: 'Open Sans', sans-serif;
}
set this:
#panel-1{
position:absolute;
top:0px;
left:0px;
bottom:0px;
right:0px;
}
This question already has answers here:
Text in Border CSS HTML
(10 answers)
Closed 4 years ago.
I'm creating my CV website with Bootstrap and I have a question according to border element with <p>.
I have this HTML/CSS part :
.headline {
position: relative;
display: inline-block;
border: 1px solid #252525;
margin-bottom: 120px;
color: #252525;
font: 12px 'PT Sans', sans-serif;
line-height: 20px;
text-align: center;
}
<div id="profil" class="container-fluid">
<div class="row">
<div class="span12 text-center">
<div class="headline">
<p>
<span> QUI SUIS-JE ? </span>
</p>
<h1>MON PROFIL</h1>
</div>
</div>
</div>
</div>
I would like to get something like this :
How I could modify my CSS file in order to get this ?
Thank you !
Use <fieldset> and <legend>
.headline {
position: relative;
display: inline-block;
border: 1px solid #252525;
margin-bottom: 120px;
color: #252525;
font: 12px 'PT Sans', sans-serif;
line-height: 20px;
text-align: center;
}
<div id="profil" class="container-fluid">
<div class="row">
<div class="span12 text-center">
<fieldset class="headline">
<legend> QUI SUIS-JE ? </legend>
<h1>MON PROFIL</h1>
</fieldset>
</div>
</div>
</div>
Maybe something like this?
.headline {
position: relative;
display: inline-block;
border: 1px solid #252525;
margin-bottom: 120px;
color: #252525;
font: 12px 'PT Sans', sans-serif;
line-height: 20px;
text-align: center;
}
.header {
position: absolute;
top: 0;
left: 50%;
width: 100px;
transform: translate(-50%, -100%);
background: #FFFFFF;
}
<div id="profil" class="container-fluid">
<div class="row">
<div class="span12 text-center">
<div class="headline">
<p class="header">
<span> QUI SUIS-JE ? </span>
</p>
<h1>MON PROFIL</h1>
</div>
</div>
</div>
</div>
I am stuck, I want to make the height of my left column equal to the height of the right column . Seems the problem is the width of my video but I know how to fix this issue
I put in code this :
#font-face {
font-family: "poppins-bold";
src: url('../css/fonts/Poppins-Bold.ttf');
}
#font-face {
font-family: "poppins-light";
src: url('../css/fonts/Poppins-Light.ttf');
}
#font-face {
font-family: "poppins-medium";
src: url('../css/fonts/Poppins-Medium.ttf');
}
#font-face {
font-family: "poppins-regular";
src: url('../css/fonts/Poppins-Regular.ttf');
}
#font-face {
font-family: "poppins-semibold";
src: url('../css/fonts/Poppins-SemiBold.ttf');
}
body {
margin: 0;
background-color: #0080b9;
}
.conteneur {
min-width: 1050px;
}
.light {
font-family: "poppins-light";
}
.video-cover {
width: 100%;
height: 175px;
background-color: gray;
margin-top: 10px;
margin-bottom: 50px;
}
#bloc-gauche {
background-color: white;
width: 25%;
float: left;
/*height: 900px;*/
height: 100vh;
color: #0080b9;
font-family: "poppins-semibold";
overflow: scroll;
/*
padding-left:20px;
padding-right:20px;
padding-top:20px;
*/
}
.wrapper-bloc-gauche {
padding-left: 30px;
padding-right: 30px;
padding-top: 30px;
}
#intro {
width: 185px;
margin-bottom: 50px;
}
#content-bloc-droite {
padding-top: 25px;
}
#bloc-droite {
background-color: #0080b9;
width: 75%;
float: right;
font-family: "poppins-semibold";
color: white;
background-repeat: repeat-x;
}
.center-block {
display: block;
margin-right: auto;
margin-left: auto;
}
#description {
font-size: 15px;
text-align: center;
width: 45%;
margin-top: 25px;
}
.video-player-container {
/*width:40%;*/
display: block;
margin-right: auto;
margin-left: auto;
margin-top: 50px;
margin-bottom: 40px;
}
.video-player {
width: 100%;
border: 5px solid #ECECEC;
box-sizing: border-box;
}
.footer-bloc-droite {
text-align: center;
padding-left: 30px;
padding-right: 30px;
overflow: hidden;
}
#logo-joon {
float: left;
width: 200px;
}
#btn-xp {
display: inline-block;
margin: 0 auto;
background-color: white;
padding-right: 15px;
padding-left: 15px;
padding-top: 10px;
padding-bottom: 10px;
color: #0080b9;
}
#joon-p {
float: right;
width: 200px;
}
#joon-p-img {
/*transform: rotate(-20deg);
padding-bottom: 0px;
-webkit-transform-origin-x: -55px;
overflow: hidden;
*/
-webkit-transform-origin-x: -55px;
width: 95%;
}
#left-block {
float: left;
}
#right-block {
float: right;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class='conteneur'>
<div id='bloc-gauche'>
<div class='wrapper-bloc-gauche'>
<div class='row'>
<div id='intro'>
Vivez l'intégralité d'un voyage JOON avec Maxime Gasteuil
</div>
</div>
<div id='playlist'>
<div class='video-preview'>
<div class='video-title'>Ep 1 <span class='light'>Lorem Ipsum dolores sit amet</span></div>
<div class='video-cover'></div>
</div>
</div>
<div id='playlist'>
<div class='video-preview'>
<div class='video-title'>Ep 2 <span class='light'>Lorem Ipsum dolores sit amet</span></div>
<div class='video-cover'></div>
</div>
</div>
<div id='playlist'>
<div class='video-preview'>
<div class='video-title'>Ep 3 <span class='light'>Lorem Ipsum dolores sit amet</span></div>
<div class='video-cover'></div>
</div>
</div>
<div id='playlist'>
<div class='video-preview'>
<div class='video-title'>Ep 4 <span class='light'>Lorem Ipsum dolores sit amet</span></div>
<div class='video-cover'></div>
</div>
</div>
</div>
</div>
<div id='bloc-droite'>
<div id='content-bloc-droite'>
<div class='row'>
<img src='http://94.23.46.98/img/logo-qpV2.png' style='width:25%;' class='center-block'>
</div>
<div class='row'>
<div id='description' style='text-align:center;' class='center-block'>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis veritatis, fugit quia repudiandae est dignissimos modi expedita ullam totam, aliquid odit voluptas omnis dolores nemo nam
</div>
</div>
<div class='row'>
<div class='video-player-container center-bloc'>
<video controls class='video-player center-block' style='min-width:475px;max-width:40%;'>
<source src='http://web1.fr-hmd.com/adpulse/videos-adpulse/joon-1.mp4' type="video/mp4">
</video>
</div>
</div>
<div class='footer-bloc-droite'>
<div class='row'>
<div id='logo-joon'>
<img src='http://94.23.46.98/img/logo-joon.png' width='150px;'>
</div>
<div id='btn-xp'>
Démarrer l'expérience de voyage
</div>
<div id='joon-p'>
<img src='http://94.23.46.98/img/logo-pV2.png' width='240px;' id='joon-p-img'>
</div>
<div style='clear:both'></div>
</div>
</div>
</div>
</div>
<div style='clear:both'></div>
</div>
I have a another little problem: I wanted to put the plane little up.
I tried to use position:absolute but all other element is not centered.
You provided so much code, that is useless and as you can no one cared to fix your issue, anyway all i'm going to say is that i tried to add certain height:100% and height:100vh on some wrapper elements and it should work now.
#font-face {
font-family: "poppins-bold";
src: url('../css/fonts/Poppins-Bold.ttf');
}
#font-face {
font-family: "poppins-light";
src: url('../css/fonts/Poppins-Light.ttf');
}
#font-face {
font-family: "poppins-medium";
src: url('../css/fonts/Poppins-Medium.ttf');
}
#font-face {
font-family: "poppins-regular";
src: url('../css/fonts/Poppins-Regular.ttf');
}
#font-face {
font-family: "poppins-semibold";
src: url('../css/fonts/Poppins-SemiBold.ttf');
}
body {
margin: 0;
background-color: #0080b9;
}
.conteneur {
min-width: 1050px;
height: 100vh;
}
.light {
font-family: "poppins-light";
}
.video-cover {
width: 100%;
height: 175px;
background-color: gray;
margin-top: 10px;
margin-bottom: 50px;
}
#bloc-gauche {
background-color: white;
width: 25%;
float: left;
/* height: 900px; */
height: 100vh;
color: #0080b9;
font-family: "poppins-semibold";
overflow: scroll;
/*
padding-left:20px;
padding-right:20px;
padding-top:20px;
*/
}
.wrapper-bloc-gauche {
padding-left: 30px;
padding-right: 30px;
padding-top: 30px;
max-height: 100%;
}
#intro {
width: 185px;
margin-bottom: 50px;
}
#content-bloc-droite {
padding-top: 25px;
max-height: 100%;
overflow: auto;
}
#bloc-droite {
background-color: #0080b9;
width: 75%;
float: right;
font-family: "poppins-semibold";
color: white;
background-repeat: repeat-x;
height: 100%;
}
.center-block {
display: block;
margin-right: auto;
margin-left: auto;
}
#description {
font-size: 15px;
text-align: center;
width: 45%;
margin-top: 25px;
}
.video-player-container {
/*width:40%;*/
display: block;
margin-right: auto;
margin-left: auto;
margin-top: 50px;
margin-bottom: 40px;
}
.video-player {
width: 100%;
border: 5px solid #ECECEC;
box-sizing: border-box;
}
.footer-bloc-droite {
text-align: center;
padding-left: 30px;
padding-right: 30px;
overflow: hidden;
}
#logo-joon {
float: left;
width: 200px;
}
#btn-xp {
display: inline-block;
margin: 0 auto;
background-color: white;
padding-right: 15px;
padding-left: 15px;
padding-top: 10px;
padding-bottom: 10px;
color: #0080b9;
}
#joon-p {
float: right;
width: 200px;
}
#joon-p-img {
/*transform: rotate(-20deg);
padding-bottom: 0px;
-webkit-transform-origin-x: -55px;
overflow: hidden;
*/
-webkit-transform-origin-x: -55px;
width: 95%;
}
#left-block {
float: left;
}
#right-block {
float: right;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
<div class='conteneur'>
<div id='bloc-gauche'>
<div class='wrapper-bloc-gauche'>
<div class='row'>
<div id='intro'>
Vivez l'intégralité d'un voyage JOON avec Maxime Gasteuil
</div>
</div>
<div id='playlist'>
<div class='video-preview'>
<div class='video-title'>Ep 1 <span class='light'>Lorem Ipsum dolores sit amet</span></div>
<div class='video-cover'></div>
</div>
</div>
<div id='playlist'>
<div class='video-preview'>
<div class='video-title'>Ep 2 <span class='light'>Lorem Ipsum dolores sit amet</span></div>
<div class='video-cover'></div>
</div>
</div>
<div id='playlist'>
<div class='video-preview'>
<div class='video-title'>Ep 3 <span class='light'>Lorem Ipsum dolores sit amet</span></div>
<div class='video-cover'></div>
</div>
</div>
<div id='playlist'>
<div class='video-preview'>
<div class='video-title'>Ep 4 <span class='light'>Lorem Ipsum dolores sit amet</span></div>
<div class='video-cover'></div>
</div>
</div>
</div>
</div>
<div id='bloc-droite'>
<div id='content-bloc-droite'>
<div class='row'>
<img src='http://94.23.46.98/img/logo-qpV2.png' style='width:25%;' class='center-block'>
</div>
<div class='row'>
<div id='description' style='text-align:center;' class='center-block'>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quis veritatis, fugit quia repudiandae est dignissimos modi expedita ullam totam, aliquid odit voluptas omnis dolores nemo nam
</div>
</div>
<div class='row'>
<div class='video-player-container center-bloc'>
<video controls class='video-player center-block' style='min-width:475px;max-width:40%;'>
<source src='http://web1.fr-hmd.com/adpulse/videos-adpulse/joon-1.mp4' type="video/mp4">
</video>
</div>
</div>
<div class='footer-bloc-droite'>
<div class='row'>
<div id='logo-joon'>
<img src='http://94.23.46.98/img/logo-joon.png' width='150px;'>
</div>
<div id='btn-xp'>
Démarrer l'expérience de voyage
</div>
<div id='joon-p'>
<img src='http://94.23.46.98/img/logo-pV2.png' width='240px;' id='joon-p-img'>
</div>
<div style='clear:both'></div>
</div>
</div>
</div>
</div>
<div style='clear:both'></div>
</div>
I have a set of 6 divs nested in another div. i have a border-radius set for the parent and no border radius on the nested divs. their combined width is exactly the width of the inner area of the parent div. they are all floated left. in this setup, the corners of the children spill over the rounded corners of the parent. setting overflow to hidden seems to do nothing.
Does anyone know how to hide those corners that are overflowing from the parent?
I am using a css reset which is not in the attached code. that particular file is available here: reset.css
And a link to this page (so you can see what i mean)
79.170.44.85/rasmussenprojects.com/home.html
EDIT: heres a screenshot of what firefox shows in case its not displaying properly for you:
i.stack.imgur.com/OHkng.png
<!doctype html>
<html>
<head>
<title>Home</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" type="text/css" href="reset.css">
<!--
<link rel="stylesheet" type="text/css" href="home.css">
-->
<style>
html, body{
background-color:rgb(32,32,32);
width:1366px;
height:637px;
position:relative;
}
#banner_logotext{
color:rgb(16,16,16);
width:1074px;
text-align:center;
font-size:32px;
font-weight:700;
font-family:Arial, Helvetica, sans-serif;
}
#banner_slogantext{
color:rgb(16,16,16);
width:1074px;
text-align:center;
font-size:12px;
line-height:6px;
margin-top:8px;
}
.content-panel{
background-color:rgb(64,64,64);
margin:0 auto;
border: 2px solid rgb(16,16,16);
border-radius:16px;
}
#banner{
width:1074px;
height:90px;
padding-top:8px;
}
#navbar{
width:1074px;
height:45px;
}
.navbar-tab{
width:178.333333333px;
height:41px;
float: left;
background-color:rgb(48,48,48);
border: 2px solid black;
}
</style>
</head>
<body>
<div class="content-panel" id="banner">
<p id="banner_logotext">
Lorem ipsum dolor sit amet
</p>
<p id="banner_slogantext">
"Neque porro quisquam est qui dolorem ipsum
<br></br>quia dolor sit amet, consectetur, adipisci velit..."
</p>
</div>
<div class="content-panel" id="navbar">
<div class="navbar-tab">
</div>
<div class="navbar-tab">
</div>
<div class="navbar-tab">
</div>
<div class="navbar-tab">
</div>
<div class="navbar-tab">
</div>
<div class="navbar-tab">
</div>
</div>
</body>
</html>
When you set overflow:hidden you are telling an element to hide any children that overflow out its bounds. As such, in your scenario, you have to set it for the #navbar instead of for each .navbar-tab.
#navbar{ overflow:hidden; }
As was mentioned by Justin Breiland, you can also round some of the corners of the first and last .navbar-tabs for better presentation.
.navbar-tab:first-child { border-top-left-radius: 13px; border-bottom-left-radius: 13px; }
.navbar-tab:last-child { border-top-right-radius: 13px; border-bottom-right-radius: 13px; }
Full example in snippet. Live example: http://codepen.io/anon/pen/wBeKWq
html, body{
background-color:rgb(32,32,32);
width:1366px;
height:637px;
position:relative;
}
#banner_logotext{
color:rgb(16,16,16);
width:1074px;
text-align:center;
font-size:32px;
font-weight:700;
font-family:Arial, Helvetica, sans-serif;
}
#banner_slogantext{
color:rgb(16,16,16);
width:1074px;
text-align:center;
font-size:12px;
line-height:6px;
margin-top:8px;
}
.content-panel{
background-color:rgb(64,64,64);
margin:0 auto;
border: 2px solid rgb(16,16,16);
border-radius:16px;
}
#banner{
width:1074px;
height:90px;
padding-top:8px;
}
#navbar{
width:1074px;
height:45px;
overflow:hidden;
}
.navbar-tab{
width:175px;
height:41px;
float: left;
background-color:rgb(48,48,48);
border: 2px solid black;
}
.navbar-tab:first-child{
border-top-left-radius: 13px;
border-bottom-left-radius: 13px;
}
.navbar-tab:last-child{
border-top-right-radius: 13px;
border-bottom-right-radius: 13px;
}
<div class="content-panel" id="banner">
<p id="banner_logotext">
Lorem ipsum dolor sit amet
</p>
<p id="banner_slogantext">
"Neque porro quisquam est qui dolorem ipsum
<br></br>quia dolor sit amet, consectetur, adipisci velit..."
</p>
</div>
<div class="content-panel" id="navbar">
<div class="navbar-tab">
</div>
<div class="navbar-tab">
</div>
<div class="navbar-tab">
</div>
<div class="navbar-tab">
</div>
<div class="navbar-tab">
</div>
<div class="navbar-tab">
</div>
</div>
adiing overflow:hidden works on your code
html,
body {
background-color: rgb(32, 32, 32);
width: 1366px;
height: 637px;
position: relative;
}
#banner_logotext {
color: rgb(16, 16, 16);
width: 1074px;
text-align: center;
font-size: 32px;
font-weight: 700;
font-family: Arial, Helvetica, sans-serif;
}
#banner_slogantext {
color: rgb(16, 16, 16);
width: 1074px;
text-align: center;
font-size: 12px;
line-height: 6px;
margin-top: 8px;
}
.content-panel {
background-color: rgb(64, 64, 64);
margin: 0 auto;
border: 2px solid rgb(16, 16, 16);
border-radius: 16px;
}
#banner {
width: 1074px;
height: 90px;
padding-top: 8px;
}
#navbar {
width: 1074px;
height: 45px;
overflow: hidden;
}
.navbar-tab {
width: 178.333333333px;
height: 41px;
float: left;
background-color: rgb(48, 48, 48);
border: 2px solid black;
}
<div class="content-panel" id="banner">
<p id="banner_logotext">Lorem ipsum dolor sit amet</p>
<p id="banner_slogantext">"Neque porro quisquam est qui dolorem ipsum
<br></br>quia dolor sit amet, consectetur, adipisci velit..."</p>
</div>
<div class="content-panel" id="navbar">
<div class="navbar-tab"></div>
<div class="navbar-tab"></div>
<div class="navbar-tab"></div>
<div class="navbar-tab"></div>
<div class="navbar-tab"></div>
<div class="navbar-tab"></div>
</div>