How to apply overflow:hidden;? - html

I need to hide the .content-section when going out the limit of #page.
I need to use overflow:hidden; but I cannot get the desired result applying on #page.
Any idea how to fix it?
http://jsfiddle.net/Pet8X/1/
<div id="btn-up" onclick="moveUp();">UP</div>
<div id="btn-down" onclick="moveDown();">DOWN</div>
<div id="page">
<div id="bar-header">Header</div>
<div id="content">
<div class="content-section item1 ">
<a name="anchor-1"></a>
<h2>Content 1</h2>
</div>
<div class="content-section item2">
<a name="anchor-2"></a>
<h2>Content 2</h2>
</div>
<div class="content-section item3">
<a name="anchor-3"></a>
<h2>Content 3</h2>
</div>
<div class="content-section item4">
<a name="anchor-4"></a>
<h2>Content 4</h2>
</div>
</div>
<div id="bar-footer">Footer</div>
</div>
/*resetter */
h1, h2, h3, h4, h5, h6 {
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
background: transparent;
width: 500px;
height: 200px;
}
ul {
list-style-type: none;
margin: 0px;
padding: 0px;
}
#bar-header, #bar-footer {
position: fixed;
left: 0px;
width: 500px;
height: 30px;
z-index: 100;
background-color: rgba(50,50,50,0.5);
text-align: center;
}
#bar-header {
top: 0px;
}
#bar-footer {
top: 690px;
}
#btn-up, #btn-down {
position: fixed;
left: 1230px;
width: 50px;
height: 50px;
background-color: yellow;
outline: 1px solid black;
z-index: 200;
}
#btn-up {
top: 0px;
}
#btn-down {
top: 50px;
}
#content {
position: fixed;
}
#content-inner {
overflow: hidden;
}
.content-section {
background-color: lightgray;
outline: 1px solid black;
width: 50px;
}
/* content sizes */
.item1 { /* top is 0 */
height: 200px;
}
.item2 { /* top is 200 */
height: 400px;
}
.item3 { /* top is 600 */
height: 600px;
}
.item4 {
height: 800px;
}
.content-section h2 {
position: relative;
top: 30px; /**avoid to go under the header bar*/
}
.active {
background-color: violet !important;
}

You are referencing the ID of the sidebar container incorrectly.
Your rule states
#content {
position: fixed;
}
#content-inner {
overflow: hidden;
}
But there is no element #content-inner.
Use this instead:
#content{
position: fixed;
overflow: hidden;
}
This results in:
Fiddle

Just apply overflow-hidden to #content
#content{
position: fixed;
overflow: hidden;
}

Related

Vertical divs with divisions

I want to create a page on my site with X vertical divisions. These span from the top to the bottom of the page and take up, say 10vw.
This is fine, however what I am struggling with now is that INSIDE those vertical divs I want sections. Some of the vertical divs will have 1 section, some 2, and some three.
This is a fiddle of what I have so far
#topics_selection-container {
position: absolute;
top: 0;
left: 0;
right: 27px;
bottom: 20px;
overflow-x: auto;
overflow-y: none;
white-space: nowrap;
}
.topics_selection-level_container {
display: inline-block;
height: 99.5%;
width: 10vw;
margin: 0px -5px 0px 0px;
overflow: none;
}
.topics_selection-split_cell_1 {
background: green;
margin: 0px;
height: 100%;
}
.topics_selection-split_cell_2 {
background: gray;
margin: 0px;
height: 50%;
}
.topics_selection-split_cell_3 {
background: blue;
margin: 0px;
height: 50%;
}
.topics_selection-split_cell_4 {
background: magenta;
margin: 0px;
height: 33%;
}
.topics_selection-split_cell_5 {
background: orange;
margin: 0px;
height: 33%;
}
.topics_selection-split_cell_6 {
background: purple;
margin: 0px;
height: 33%;
}
.topics_selection-level_1 {
background: red;
}
.topics_selection-level_2 {
background: yellow;
}
<div id="topics_selection-container">
<div class="topics_selection-level_container topics_selection-level_1">
<div class="topics_selection-split_cell_1"></div>
</div>
<div class="topics_selection-level_container topics_selection-level_2">
<div class="topics_selection-split_cell_2"></div>
<div class="topics_selection-split_cell_3"></div>
</div>
<div class="topics_selection-level_container topics_selection-level_2">
<div class="topics_selection-split_cell_4"></div>
<div class="topics_selection-split_cell_5"></div>
<div class="topics_selection-split_cell_6"></div>
</div>
</div>
And as you SEE it works! Thats exactly what I want (except for the small space at the bottom of the three because of the 33%). However when I put content into those smaller divisions you get something different happening. The kind of wrap to the size of the text.
Can anybody suggest how to fix this? Positioning is CSS is not my forte!
Change overflow: none; into overflow: hidden; in .topics_selection-level_container. That will do the trick.
.topics_selection-level_container { display: inline-block; height: 99.5%; width: 10vw; margin: 0px -5px 0px 0px; overflow: hidden; }
https://jsfiddle.net/48tvezgv/4/
You could use flex for this then the level 2 divs can just grow to fit the column:
#topics_selection-container {
position: absolute;
top: 0;
left: 0;
right: 27px;
bottom: 20px;
overflow-x: auto;
overflow-y: none;
display: flex;
flex-direction: row; /* align level 1 children in columns */
flex-wrap: wrap;
}
.topics_selection-level_container {
height: 99.5%;
width: 10vw;
margin: 0px; /* not sure what your left margin was doing so removed it - you can add it back if you want */
overflow: none;
display: flex;
flex-direction: column; /* align level 2 children in rows within this column */
flex-wrap: nowrap;
}
.topics_selection-level_container > div {
flex:1; /* make level2 children grow to fill the column equally */
display:flex;
align-items: center; /* this is for vertical aligning */
justify-content: center; /* these 2 are for horizontal aligning */
text-align:center;
}
.topics_selection-split_cell_1 {
background: green;
}
.topics_selection-split_cell_2 {
background: gray;
}
.topics_selection-split_cell_3 {
background: blue;
}
.topics_selection-split_cell_4 {
background: magenta;
}
.topics_selection-split_cell_5 {
background: orange;
}
.topics_selection-split_cell_6 {
background: purple;
}
.topics_selection-level_1 {
background: red;
}
.topics_selection-level_2 {
background: yellow;
}
<div id="topics_selection-container">
<div class="topics_selection-level_container topics_selection-level_1">
<div class="topics_selection-split_cell_1">add</div>
</div>
<div class="topics_selection-level_container topics_selection-level_2">
<div class="topics_selection-split_cell_2">stuff may be over multiple lines</div>
<div class="topics_selection-split_cell_3">stuff</div>
</div>
<div class="topics_selection-level_container topics_selection-level_2">
<div class="topics_selection-split_cell_4">stuff that can wrap</div>
<div class="topics_selection-split_cell_5">this works</div>
<div class="topics_selection-split_cell_6">yeah!</div>
</div>
</div>
If you switch to floats, it'll work.
.topics_selection-level_container { float:left; height: 99.5%; width: 10vw; margin: 0; }
https://jsfiddle.net/48tvezgv/3/
#topics_selection-container { position: absolute; top: 0; left: 0; right: 27px; bottom: 20px; overflow-x: auto; overflow-y: hidden; }
.topics_selection-level_container { float:left; height: 99.5%; width: 10vw; margin: 0; }
.topics_selection-split_cell_1 { background: green; margin: 0px; height: 100%; }
.topics_selection-split_cell_2 { background: gray; margin: 0px; height: 50%; }
.topics_selection-split_cell_3 { background: blue; margin: 0px; height: 50%; }
.topics_selection-split_cell_4 { background: magenta; margin: 0px; height: calc(100% / 3); }
.topics_selection-split_cell_5 { background: orange; margin: 0px; height: calc(100% / 3); }
.topics_selection-split_cell_6 { background: purple; margin: 0px; height: calc(100% / 3); }
.topics_selection-level_1 { background: red; }
.topics_selection-level_2 { background: yellow; }
<div id="topics_selection-container">
<div class="topics_selection-level_container topics_selection-level_1">
<div class="topics_selection-split_cell_1">zxczxc</div>
</div>
<div class="topics_selection-level_container topics_selection-level_2">
<div class="topics_selection-split_cell_2">asdas</div>
<div class="topics_selection-split_cell_3">qweqwe</div>
</div>
<div class="topics_selection-level_container topics_selection-level_2">
<div class="topics_selection-split_cell_4">cvbcvb</div>
<div class="topics_selection-split_cell_5">urtyryr</div>
<div class="topics_selection-split_cell_6">hdhdfh</div>
</div>
</div>
Also "none" is not a valid value for overflow, I think you want to use hidden. And 33% is not precise enough, use calc (100% / 3)
Use height:33.333333% instead of 33% as 33*3=99...so your 1% is remaining...
You have applied display:inline-block to the outer containers which has by default vertical-align:baseline...
You have to change it to vertical-align:top
Updated Fiddle
Stack Snippet
#topics_selection-container {
position: absolute;
top: 0;
left: 0;
right: 27px;
bottom: 20px;
overflow-x: auto;
overflow-y: none;
white-space: nowrap;
}
.topics_selection-level_container {
display: inline-block;
height: 99.5%;
width: 10vw;
margin: 0px -5px 0px 0px;
overflow: none;
vertical-align: top;
}
.topics_selection-split_cell_1 {
background: green;
margin: 0px;
height: 100%;
}
.topics_selection-split_cell_2 {
background: gray;
margin: 0px;
height: 50%;
}
.topics_selection-split_cell_3 {
background: blue;
margin: 0px;
height: 50%;
}
.topics_selection-split_cell_4 {
background: magenta;
margin: 0px;
height: 33.333333%;
}
.topics_selection-split_cell_5 {
background: orange;
margin: 0px;
height: 33.333333%;
}
.topics_selection-split_cell_6 {
background: purple;
margin: 0px;
height: 33.333333%;
}
.topics_selection-level_1 {
background: red;
}
.topics_selection-level_2 {
background: yellow;
}
<div id="topics_selection-container">
<div class="topics_selection-level_container topics_selection-level_1">
<div class="topics_selection-split_cell_1"></div>
</div>
<div class="topics_selection-level_container topics_selection-level_2">
<div class="topics_selection-split_cell_2"></div>
<div class="topics_selection-split_cell_3"></div>
</div>
<div class="topics_selection-level_container topics_selection-level_2">
<div class="topics_selection-split_cell_4">ggg</div>
<div class="topics_selection-split_cell_5">ffff</div>
<div class="topics_selection-split_cell_6">dddd</div>
</div>
</div>
You just need to adjust the height a little you can give one 34% or give them all 33% with more decimal points.
EDIT: Added content to each inner div and align elements to top of parents.
#topics_selection-container { position: absolute; top: 0; left: 0; right: 27px; display:inline-block; bottom: 20px; overflow-x: auto; vertical-align:top; overflow-y: none; white-space: nowrap; }
.topics_selection-level_container { display: inline-block; height: 99.5%; width: 10vw; margin: 0px -5px 0px 0px; overflow: none; }
.topics_selection-split_cell_1 { background: green; margin: 0px; height: 100%; }
.topics_selection-split_cell_2 { background: gray; margin: 0px; height: 50%; }
.topics_selection-split_cell_3 { background: blue; margin: 0px; height: 50%; }
.topics_selection-split_cell_4 { background: magenta; margin: 0px; height: 34%; }
.topics_selection-split_cell_5 { background: orange; margin: 0px; height: 33%; }
.topics_selection-split_cell_6 { background: purple; margin: 0px; height: 33%; }
.topics_selection-level_1 { background: red; vertical-align:top; }
.topics_selection-level_2 { background: yellow; vertical-align:top; }
<div id="topics_selection-container">
<div class="topics_selection-level_container topics_selection-level_1">
<div class="topics_selection-split_cell_1">asdf</div>
</div>
<div class="topics_selection-level_container topics_selection-level_2">
<div class="topics_selection-split_cell_2">asdf</div>
<div class="topics_selection-split_cell_3">asdf</div>
</div>
<div class="topics_selection-level_container topics_selection-level_2">
<div class="topics_selection-split_cell_4">asdf</div>
<div class="topics_selection-split_cell_5">asdf</div>
<div class="topics_selection-split_cell_6">asdf</div>
</div>
</div>

make responsive a css + html design

I created a layout with 4 columns centered with margin and a triangle as an arrow-down with a star in the middle...
this is working nice in my computer:
But triangle and star are far away to be responsive, only way I achieved to position it correctly is with absolute position:
.triangle-down {
display: block;
position: absolute;
top: 0;
left: 318px;
width: 0;
height: 0;
border-left: 532px solid transparent;
border-right: 532px solid transparent;
border-top: 400px solid blue;
}
.star {
display: block;
position: absolute;
vertical-align: middle;
font-size: 250px;
text-align: center;
color: white;
top: -434px;
left: -109px;
}
How can I put the element in top of the others and make it responsive in the same way columns and it's margins?
NOTES:
layout is a countdown, but javascript is not important for the question.
You can find a functional (no JS) fiddle here
You can see actual result (with JS) here
I can use sass if necessary
How about this updated fiddle?
https://jsfiddle.net/ondrakoupil/0rtvcnon/11/
Basically, these are the changes:
use flexbox for column layout
sizes are measured using viewport-relative units (vw)
triangle is created as standard rectangular <div> and rotated via CSS - you have better control over its position and size
There are some CSS3 techniques used. For IE, you'll need to prefix them in CSS (use Autoprefixer). Other browsers should handle it "as it is".
html, body {
height: 100%;
margin: auto;
padding-left:1%;
background: yellow;
font: normal 16px 'Roboto', sans-serif;
}
.container {
margin: auto;
width: 80%;
height: 100%;
position: relative;
display: flex;
justify-content: space-between;
}
.bar {
background: red;
font-weight: 700;
text-align: center;
color: yellow;
width: 15%;
}
.init {
position:absolute;
bottom: 10px;
right: 20px;
background: yellow;
margin-left: 0px;
font-weight: 700;
text-align: right;
color: red;
}
a:link, a:visited {
color: red;
text-decoration: none;
}
::-moz-selection {
color: yellow;
background: red;
}
::selection {
color: yellow;
background: red;
}
p.numbers {
font-size: 8vw;
margin-top: 45vw;
margin-bottom: 20px;
}
p.meta, p.strings {
font-size: 2vw;
}
h1 {
font-size: 4.5em;
}
.triangle-down {
position: absolute;
top: 0;
left: 0;
right: 0;
pointer-events: none;
}
.triangle-color {
margin: auto;
width: calc(80vw / 1.4142);
height: calc(80vw / 1.4142); /* sqrt of 2 */
background-color: blue;
transform: translateY(calc(-1 * 80vw / 1.4142 / 2)) rotate(45deg);
}
.star {
position: absolute;
vertical-align: middle;
font-size: 15vw;
text-align: center;
color: white;
top: 5vw;
left: 0;
right: 0;
z-index: 1;
}
<body>
<div class="container">
<div class="triangle-down">
<div class="triangle-color"></div>
<div class="star">★</div>
</div>
<div class="bar">
<p id="d" class="numbers days">00</p>
<p class="strings">DIES</p>
</div>
<div class="bar">
<p id="h" class="numbers hours">00</p>
<p class="strings">HORES</p>
</div>
<div class="bar">
<p id="m" class="numbers minutes">00</p>
<p class="strings">MINUTS</p>
</div>
<div class="bar">
<p id="s" class="numbers seconds">00</p>
<p class="strings">SEGONS</p>
</div>
</div>
<div class="init">
ENTRA
</div>
</body>
Take a look at this. I was need to rewrite it from scratch, because you've got a lot of absolutes and they all calculated through js, as I understood. Hope, this will satisfy your requirements.
html, body {
margin: 0;
height: 100%;
}
.container {
width: 100%;
height: 100%;
background-color: yellow;
font: normal 16px 'Roboto', sans-serif;
position: relative;
}
.triangle-aspect-keeper {
width: 50%;
padding-bottom: 50%;
position: relative;
margin-left: auto;
margin-right: auto;
}
.triangle-container {
}
.triangle-down {
width: 100%;
height: 100%;
background-color: blue;
transform: rotate(45deg);
position: absolute;
top: -50%;
left: 0;
}
.star {
font-size: 1100%;
text-align: center;
color: white;
width: 100%;
line-height: 200%; /* control star vertical position */
position: absolute;
top: 0;
left: 0;
}
.bar-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-align: center;
}
.bar-inner-container {
margin-left: auto;
margin-right: auto;
width: calc(50% * 1.41); /* sqrt(2) = 1.41. Length of the diagonal of the square*/
height: 100%;
display: flex;
justify-content: space-between;
}
.bar:first-child {
margin-left: 0;
}
.bar {
background-color: red;
height: 100%;
width: 15%;
color: yellow;
font-weight: 700;
}
p.numbers {
font-size: 5em;
margin-top: 350%;
}
p.meta, p.strings {
font-sie: 1.5em;
}
a:link, a:visited {
color: red;
text-decoration: none;
}
.init {
position: absolute;
bottom: 0;
right: 0;
padding: 10px;
font-weight: 700;
}
<body>
<div class="container">
<div class="bar-container">
<div class="bar-inner-container">
<div class="bar bar-first">
<p id="d" class="numbers days">00</p><br>
<p class="strings">DIES</p><br>
</div>
<div class="bar bar-second">
<p id="h" class="numbers hours">00</p><br>
<p class="strings">HORES</p><br>
</div>
<div class="bar bar-third">
<p id="m" class="numbers minutes">00</p><br>
<p class="strings">MINUTS</p><br>
</div>
<div class="bar bar-fourth">
<p id="s" class="numbers seconds">00</p><br>
<p class="strings">SEGONS</p><br>
</div>
</div>
</div>
<div class="triangle-aspect-keeper">
<div class="triangle-container">
<div class="triangle-down"></div>
<div class="star">★</div>
</div>
</div>
<div class="init">
ENTRA
</div>
</div>
</body>
#import url('https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css');
html,
body {
background: yellow;
height: 100%;
}
.container {
position: relative;
height: 100%;
}
.row {
height: 100%;
}
.col-xs-3 {
height: 100%;
}
.col-xs-3,
.col-xs-12 {
padding: 0 6.25%;
}
.bar {
color: yellow;
background: red;
min-height: 100%;
padding-top: 333%;
}
.triangle-down {
position: absolute;
width: 100%;
height: auto;
z-index: 1;
}
.triangle-color {
margin-bottom: -30%;
}
.triangle-color * {
fill: blue
}
.star * {
fill: white
}
.numbers {
font-size: 5vw;
padding-bottom: 2vw;
}
.strings {
font-size: 1.5vw;
}
<div class="container text-center">
<div class="row triangle-down">
<div class="col-xs-12">
<svg class="triangle-color" viewBox="0 0 100 40">
<polygon points="0,0 100,0 50,40"/>
</svg>
<svg class="star" viewBox="0 0 1400 188">
<polygon points="700,0 640,188 790,68 610,68 760,188"/>
</svg>
</div>
</div>
<div class="row">
<div class="col-xs-3">
<div class="bar">
<div class="numbers">00</div>
<div class="strings">DIES</div>
</div>
</div>
<div class="col-xs-3">
<div class="bar">
<div class="numbers">00</div>
<div class="strings">HORES</div>
</div>
</div>
<div class="col-xs-3">
<div class="bar">
<div class="numbers">00</div>
<div class="strings">MINUTS</div>
</div>
</div>
<div class="col-xs-3">
<div class="bar">
<div class="numbers">00</div>
<div class="strings">SEGONS</div>
</div>
</div>
</div>
</div>
You can simply do this.
HTML:
<div class="parent">
<div class="triangle">
<div class="star">
...
</div>
</div>
</div>
CSS:
.parent {
width: xx%; /*Whatever percentage*/
height: yy%; /*Whatever percentage*/
margin: 0 auto;
position: relative;
}
.triangle {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.star {
font-size: xx%; /*some percentage (assuming star is a font icon)*/
position: absolute;
top: 15vh;
margin: 0 auto;
}

How to align 2 divs parallel to each other

I am trying to align to divs parallel from each other, but it is not lining up properly.
I have already tried a number of the solutions posted on the site, but none of them are working.
Any ideas on how to resolve this issue would be appreciated.
<section class="section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-10">
<div class="content">
<div class="wrapper">
<p class="content-media left">
<img src="http://lorempixel.com/g/400/200/" alt="">
</div>
<div>
<div class="col-xs-12">
<div class="float:right;width:45%;">
<p>Lorem Ipsum <em>Lorem</em>, Lorem impsum Lorem Ipsum Lorem Ipsum</em>.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
body {
font-family: georgia, "times new roman", times, serif
}
.container {
width: 100%;
}
.container p,
.container div img {
display: inline-block;
}
.container p {
width: 60%;
float: right;
}
.container div img {
width: 38%;
float: right;
}
.logo {
position:fixed;
bottom: 25px;
left: 0px;
height: 100px;
width: 300px;
}
p {
font-size: 18px;
line-height: 22px;
margin-right: 360px;
right: 100px;
}
.dropcap {
float: left;
font-size: 76px;
line-height: 76px;
margin: 0 15px 5px 0;
}
.section {
background-color: #fff;
position: relative;
z-index: 10;
}
.section-header {
margin-top: 50px
!important;
z-index: 1;
}
.section-header-content {
position: fixed;
bottom: 400px;
left: 200px;
color: white;
}
.main-title {
position: fixed;
bottom: 400px;
left: 200px;
color: white;
}
.section-header-content2 {
position: fixed;
bottom: 50px;
left: 200px;
color: white;
}
.main-title2 {
position: fixed;
bottom: 400px;
right: 200px;
color: white;
}
.section-video-bg {
margin-top: -10px;
}
.content {
padding: 40px 0 25 ;
}
.content h3 {
font-size: 27px;
line-height: 27px;
margin: 70px 0 30px 0;
}
.content .content-media {
width: 40%;
border-top: 1px solid #FFFFFF;
border-bottom: 1px solid #FFFFFF;
padding: 30px 0;
}
.content .content-media.right {
float: right;
margin-left: 20px;
}
.content .content-media.left {
float: right;
margin-right: 800px;
bottom: 600px;
}
.content .content-media img {
max-width: 100%;
}
.column {
float: left;
width: 50%;
}
.video-container {
position: relative;
bottom: 0%;
left: 0%;
height: 100%;
width: 100%;
overflow: hidden;
background: #000;
}
.video-container video {
position: relative;
z-index: 0;
top: 0;
bottom: 0;
}
.video-container video.fixed {
position: fixed;
top: 50px;
z-index: 0;
bottom: 0;
}
.video-container video.fillWidth {
width: 100%;
}
.wrapper {
margin: 0 auto;
width: 960px;
}
/* Responsive: Portrait tablets and up */
#media screen and (min-width: 768px) {
}
You have a lot of stray divs on your html as well as a lot of css properties not needed (e.g. float property) which are already done by bootstrap's default css.
Here is the correct way to nest your div columns within a row:
<section class="section">
<div class="container">
<div class="row">
<div class="col-xs-6">
<div class="content">
<div class="wrapper">
<img src="http://lorempixel.com/g/400/200/" class="img-responsive" alt=""/>
</div>
</div>
</div>
<div class="col-xs-6">
<p>Lorem Ipsum <em>Lorem</em>, Lorem impsum Lorem Ipsum Lorem Ipsum.</p>
</div>
</div>
</div>
</section>
Here is a jsfiddle with the above code: http://jsfiddle.net/AndrewL32/623ftfc2/
Your HTML is not properly formatted
<div class="row">
<div class="col-xs-10 col-sm-10 col-md-6">
<img class="img-responsive" src="http://lorempixel.com/g/400/200/">
</div>
<div class="col-xs-2 col-sm-2 col-md-6">
<p>Lorem Ipsum</p>
</div>
</div>
https://jsfiddle.net/j0m6ddpo/1/

Text in the middle of image inside div

Can anyone help me figure out what i'm doing wrong?
I want to insert the text inside "servicesTitle"in the middle of the image.
I have tried position, top, vertical align..and can't figure out what i'm doing wrong
<div class="services">
<p id="titleServices">Our Services</p>
<div class="servicesImages">
<div class="servicesImagesLeft">
<div id="cultureNews">
<div class="servicesTitle">Culture News</div>
<img src="/www/assets/newImages/services/190x136/Culture News1.jpg">
</div>
<div id="meetingPoint">
<div class="servicesTitle">Meeting Point</div>
<img src="/www/assets/newImages/services/190x136/MeetingPoint1.jpg">
</div>
</div>
<div class="servicesImagesCenter">
<div id="gallery">
<img src="/www/assets/newImages/services/460x330/Gallery.jpg">
<div class="servicesTitleActive">Gallery</div>
</div>
</div>
<div class="servicesImagesRight">
<div id="profile">
<div class="servicesTitle">Profile</div>
<img src="/www/assets/newImages/services/190x136/MeetingPoint1.jpg">
</div>
<div id="invitation">
<div class="servicesTitle">Invitation
<img src="/www/assets/newImages/services/190x136/MeetingPoint1.jpg">
</div>
</div>
</div>
</div>
</div>
CSS:
html, body {
margin: 0;
padding: 0;
}
#clear {
clear: both;
}
.services {
height: 100%;
margin-left: 7.5%;
margin-right: 7.5%;
}
.services p#titleServices {
text-align: center;
color: #ffffff;
padding-top: 40px;
}
.services .servicesImages {
border: 1px solid #fff;
margin-top: 65px;
text-align:center;
}
.services .servicesImages .servicesImagesLeft {
width: 190px;
height: 136px;
margin-top: 20px;
float:left;
position: relative;
}
.services .servicesImages .servicesImagesCenter {
display: inline-block;
margin: 0 auto;
width: 460px;
height: 330px;
}
.services .servicesImages .servicesImagesRight {
width: 190px;
height: 136px;
margin-top: 20px;
float:right;
position: relative;
}
.servicesImagesLeft #cultureNews {
width: 100%;
height: 100%;
}
.servicesImagesLeft #meetingPoint {
width: 100%;
height: 100%;
margin-top: 10px;
}
.servicesImagesCenter #gallery {
width: 100%;
height: 100%;
}
.servicesImagesRight #profile {
width: 100%;
height: 100%;
}
.servicesImagesRight #invitation {
width: 100%;
height: 100%;
margin-top: 10px;
}
.servicesImagesLeft img, .servicesImagesRight img {
opacity: 0.7;
}
.servicesTitleActive {
text-align: center;
margin-top: 25px;
color: #fff;
}
.servicesTitle {
color: #fff;
}
.services p#titleServices {
Needs to be:
.services .servicesTitle {
.servicesTitle {
color: #fff;
width: 100%;
height:100%;
position: absolute;
top:60%;
left:auto;
z-index:2;
}
http://jsfiddle.net/uHY7C/

100% height child div in parent wrap div

Im here because other similar questions couldn't help my particular problem.
How can #right div height making 100% ?
Only css solution needing. Thanks.
http://jsfiddle.net/elturko/86nX9/
HTML
<div id="wrap">
<div id="header"></div>
<div id="left"></div>
<div id="right"></div>
<div id="footer"></div>
</div>
CSS
* {
margin: 0;
}
html, body {
height: 100%;
}
#wrap{
min-height: 100%;
height: auto !important;
height: 100%;
position: relative;
background:#ddd
}
#header{
height:104px;
background:#d5a1b3;
}
#left{
float:left;
width:219px;
background:#a2d025;
}
#right{
min-height: 100%;
height: auto !important;
height: 100%;
position: relative;
overflow:hidden;
background:#FFF;
margin:0 15px;
-webkit-border-radius: 7px;
-moz-border-radius: 7px;
border-radius: 7px;
padding:14px;
}
#footer{
clear:both;
height:15px;
background:#ed653a;
}
Here's 2 Pure CSS solution
Without fixing any height (header/footer) or width (left column).
I actually prefer the second solution. (even tho he has less browser support)
1 - using CSS tricks
this is a totally responsive design and work well with all browsers (IE10, FF, Chrome, Safari, Opera, mobile browsers)
Working Fiddle
HTML:
<div class="Container">
<div class="Header">
</div>
<div class="HeightTaker">
<div class="Wrapper Container Inverse">
<div>
<div class="Footer">
</div>
</div>
<div class="HeightTaker">
<div class="Wrapper">
<div class="LeftMenu">
</div>
<div class="Content">
</div>
</div>
</div>
</div>
</div>
</div>
CSS:
*
{
margin: 0;
padding: 0;
}
html, body, .Container
{
height: 100%;
}
.Container:before
{
content: '';
height: 100%;
float: left;
}
.HeightTaker
{
position: relative;
z-index: 1;
}
.HeightTaker:after
{
content: '';
clear: both;
display: block;
}
.Wrapper
{
position: absolute;
width: 100%;
height: 100%;
}
.Inverse, .Inverse > *
{
-moz-transform: rotateX(180deg);
-ms-transform: rotateX(180deg);
-o-transform: rotate(180deg);
-webkit-transform: rotateX(180deg);
transform: rotateX(180deg);
}
.LeftMenu
{
height: 100%;
float: left;
}
.Content
{
overflow: auto;
height: 100%;
}
/*For demonstration only*/
p
{
font-size: 1.3em;
}
.Important
{
font-weight: bolder;
color: white;
}
body > .Container
{
text-align: center;
}
.Header
{
background-color: #bf5b5b;
}
.LeftMenu
{
background-color: #bdbe4c;
}
.Content
{
background-color: #90adc1;
}
.Footer
{
background-color: #b5a8b7;
}
2 - using Flex
This layout can also be achieved using flex, but the current browser support is pure.
Here's a Working Fiddle only FF,Chrome,IE10.
HTML: (simpler)
<header>
</header>
<section class="Middle">
<div class="LeftMenu">
</div>
<div class="Content">
</div>
</section>
<footer>
</footer>
CSS:
*
{
margin: 0;
padding: 0;
}
html, body
{
height: 100%;
text-align: center;
}
body
{
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
.Middle
{
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 0;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
overflow: hidden;
}
.Content
{
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 0 0;
overflow: auto;
}
/*For demonstration only*/
p
{
font-size: 1.3em;
}
.Important
{
font-weight: bolder;
color: white;
}
header
{
background-color: #bf5b5b;
}
.LeftMenu
{
background-color: #bdbe4c;
}
.Content
{
background-color: #90adc1;
}
footer
{
background-color: #b5a8b7;
}
Take this out of css for #right{} :
margin:0 15px;
This will make it wide 100%. I'm a little confused on the 100% height. Did you meant wide?
Important will over-ride other CSS attributes and auto will make the div as large as it needs to be to fit the contents.
height: auto !important;
height: 100%;
Try this:
#right{
min-height: 100%;
height: auto !important;
height: 100%;
position: relative;
overflow:hidden;
background:#FFF;
margin:0 15px;
-webkit-border-radius: 7px;
-moz-border-radius: 7px;
border-radius: 7px;
padding:14px;
top: 0px;
bottom: 0px;
}
Add top: 0px; bottom: 0px; to your #right css
I restructured your html a bit. Is that your desired outcome?
jsfiddle
<div id="container">
<div id="wrap">
<div id="header">
header
</div>
<div id="body">
<div id="left">
left
</div>
<div id="right">
right<br>
right<br>
right<br>
right<br>
right<br>
</div>
</div>
</div>
</div>
<div id="footer">
<p>footer</p>
</div>
css
html, body {
height: 100%;
padding: 0px;
margin: 0px;
}
#container {
height: 100%;
height: auto !important;
min-height: 100%;
}
#wrap {
overflow: auto;
padding-bottom: 16px;
}
#header {
height: 104px;
background:#d5a1b3;
border-bottom: 1px solid #000;
}
#body {
overflow: hidden;
height: 100%;
}
#right {
margin: 0px 0px 0px 220px;
background:#FFF;
}
#left {
width: 219px;
float: left;
background:#a2d025;
}
#footer {
background:#ed653a;
border-top: 1px solid #000;
position: relative;
height: 20px;
margin-top: -21px;
clear: both;
}
#footer p {
margin: 0px;
}