Looks like there is a chrome bug that hides content of columns greater than one. Really stumped on this one. Also looks like the easing on the hover is not working nicely on columns 2 and 3 as well.
<div class="col3">
<div id="box">
<div class="content-item-description">
Weekly Sales - Limited Time Only - While Supplies Last!
</div>
<div id="overlay">
<span id="plus">This is cool</span>
</div>
</div>
<div id="box">
<div class="content-item-description">
Weekly Sales - Limited Time Only - While Supplies Last!
</div>
<div id="overlay">
<span id="plus">This is cool</span>
</div>
</div>
<div id="box">
<div class="content-item-description">
Weekly Sales - Limited Time Only - While Supplies Last!
</div>
<div id="overlay">
<span id="plus">This is cool</span>
</div>
</div>
</div>
and here is the CSS
body {
background: #e7e7e7;
}
#box {
width: 300px;
height: 200px;
box-shadow: inset 1px 1px 40px 0 rgba(0,0,0,.45);
border-bottom: 2px solid #fff;
border-right: 2px solid #fff;
margin: 5% auto 0 auto;
background: url(http://ianfarb.com/wp-content/uploads/2013/10/nicholas-hodag.jpg);
background-size: cover;
border-radius: 5px;
overflow: hidden;
position: relative;
}
#overlay {
background: rgba(0,0,0,.60);
text-align: center;
padding: 45px 0 66px 0;
opacity: 0;
-webkit-transition: opacity .25s ease;
-moz-transition: opacity .25s ease;
height: 100%;
}
#box:hover #overlay {
opacity: 1;
}
#plus {
font-family: Helvetica;
font-weight: 900;
color: rgba(255,255,255,.85);
font-size: 12px;
}
.content-item-description {
position: absolute;
}
.col3 {
-webkit-column-count: 3; /* Chrome, Safari, Opera */
-moz-column-count: 3; /* Firefox */
column-count: 3;
}
Codepen Example: http://codepen.io/anon/pen/GjyKE
first of all, all your div elements are using IDs, change them to classes or you won't be able to re-use them. So, your HTML should look like this:
<div class="col3">
<div class="box">
<div class="content-item-description">Weekly Sales - Limited Time Only - While Supplies Last!</div>
<div class="overlay"> <span class="plus">This is cool</span>
</div>
</div>
<div class="box">
<div class="content-item-description">Weekly Sales - Limited Time Only - While Supplies Last!</div>
<div class="overlay"> <span class="plus">This is cool</span>
</div>
</div>
<div class="box">
<div class="content-item-description">Weekly Sales - Limited Time Only - While Supplies Last!</div>
<div class="overlay"> <span class="plus">This is cool</span>
</div>
</div>
</div>
Now, with proper HTML, we can make better use of CSS, like this:
body {
background:#e7e7e7;
}
.box {
width:300px;
height:200px;
box-shadow:inset 1px 1px 40px 0 rgba(0, 0, 0, .45);
border-bottom:2px solid #fff;
border-right:2px solid #fff;
margin:5% auto 0 auto;
background:url(http://ianfarb.com/wp-content/uploads/2013/10/nicholas-hodag.jpg);
background-size:cover;
border-radius:5px;
overflow:hidden;
position: relative;
display:inline-block;
}
.overlay {
background:rgba(0, 0, 0, .60);
text-align:center;
padding:45px 0 66px 0;
opacity:0;
top:0;
left:0;
position:absolute;
transition: all .5s ease;
height: 100%;
width:100%;
z-index:5
}
.box:hover > .overlay {
opacity:1;
}
.plus {
font-family:Helvetica;
font-weight:900;
color:rgba(255, 255, 255, .85);
font-size:12px;
}
.content-item-description {
position: relative;
top:0;
left:0;
z-index:100;
width:100%;
height:50%;
}
In short, nothing wrong with Chrome (at least in this case), but all fault is on your coding
See you forked Codepen example
TRY - DEMO
It's a bit hack:
Use transform: translateX(-0.99px); and margin: 0px -0.5px; to the first div#box
Note: margin = -0.5px and transform = -0.99px doesn't apply any extra margin or width to your HTML elements and it also doesn't force the div#box to move or push the Next Pixel.
You can also use below CSS properties for only webkit broswers:
-webkit-margin-start: -0.5px;
-webkit-margin-end: -0.5px;
-webkit-transform: translateX(-0.99px);
HTML:
<div class="col3">
<div class="box" style="transform: translateX(-0.99px); margin: 0px -0.5px;">
<div class="content-item-description">Weekly Sales - Limited Time Only - While Supplies Last!</div>
<div class="overlay">
<span class="plus">This is cool</span>
</div>
</div>
<div class="box">
<div class="content-item-description">Weekly Sales - Limited Time Only - While Supplies Last!</div>
<div class="overlay">
<span class="plus">This is cool</span>
</div>
</div>
<div class="box">
<div class="content-item-description">Weekly Sales - Limited Time Only - While Supplies Last!</div>
<div class="overlay">
<span class="plus">This is cool</span>
</div>
</div>
</div>
CSS:
body {
background:#e7e7e7;
}
.box {
width:300px;
height:200px;
box-shadow:inset 1px 1px 40px 0 rgba(0,0,0,.45);
border-bottom:2px solid #fff;
border-right:2px solid #fff;
margin:5% auto 0 auto;
background:url(http://ianfarb.com/wp-content/uploads/2013/10/nicholas-hodag.jpg);
background-size:cover;
border-radius:5px;
overflow:hidden;
position: relative;
}
.overlay {
background:rgba(0,0,0,.60);
text-align:center;
padding:45px 0 66px 0;
opacity:0;
-webkit-transition: opacity .25s ease;
-moz-transition: opacity .25s ease; height: 100%;}
.box:hover #overlay {
opacity:1;
}
.plus {
font-family:Helvetica;
font-weight:900;
color:rgba(255,255,255,.85);
font-size:12px;
}
.content-item-description {
position: absolute;
}
.col3 {
-webkit-column-count: 3; /* Chrome, Safari, Opera */
-moz-column-count: 3; /* Firefox */
column-count: 3;
}
Related
I have 4 images and want them to be displayed 2 on each row. Each of them has a width:50% and also a float:left.
HTML
<section class="opportunity">
<div class="main">
<img src="phone.jpg" >
<div class="paragraph">This wil be centered</div>
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
<div class="main">
<img src="phone.jpg">
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
<div class="main">
<img src="phone.jpg">
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
<div class="main">
<img src="phone.jpg">
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
<div class="clearfix"></div>
</section>
CSS:
.clearfix{
clear: both;
}
section{
text-align: center;
}
.main{
float:left;
width:50%;
text-align: center;
border:10px solid white;
width:306px;
height:306px;
margin : 50px auto;
box-shadow: 0px 0px 25px black;
overflow: hidden;
}
.paragraph{
-webkit-transform: translateY(-300%);
border: 5px solid grey;
background-color: grey;
opacity: 0.5;
}
.main:hover .content,
.main:active .content{
-webkit-transform: translateY(-340px);
-webkit-transition: -webkit-transform 700ms;
}
.content{
width: 306px;
height: 306px;
background: rgba(51, 102, 255, 0.5);
}
img{
height:inherit;
width:inherit;
-webkit-transition: -webkit-transform 5000ms;
}
button{
width: 100%;
height: 50px;
margin-top: 100px;
background: black;
border: 0;
cursor: pointer;
color: white;
font: 16px tahoma;
}
button:hover
{
opacity: 0.5;
}
The problem is that all of the image are displayed within the same row. The width:50% does not seem to applied. How can I display the images two by two instead of having them all displayed on the same line?
You added width twice, with percentage and pixels, you should remove that:
.clearfix{
clear: both;
}
section{
text-align: center;
}
.some-container {
float:left;
width:50%;
position: relative;
}
.main{
text-align: center;
border:10px solid white;
width:306px;
height:306px;
margin : 50px auto;
box-shadow: 0px 0px 25px black;
overflow: hidden;
}
.paragraph{
-webkit-transform: translateY(-300%);
border: 5px solid grey;
background-color: grey;
opacity: 0.5;
}
.main:hover .content,
.main:active .content{
-webkit-transform: translateY(-340px);
-webkit-transition: -webkit-transform 700ms;
}
.content{
width: 306px;
height: 306px;
background: rgba(51, 102, 255, 0.5);
}
img{
height:inherit;
width:inherit;
-webkit-transition: -webkit-transform 5000ms;
}
button{
width: 100%;
height: 50px;
margin-top: 100px;
background: black;
border: 0;
cursor: pointer;
color: white;
font: 16px tahoma;
}
button:hover
{
opacity: 0.5;
}
<section class="opportunity">
<div class="some-container">
<div class="main">
<img src="phone.jpg" >
<div class="paragraph">This wil be centered</div>
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
</div>
<div class="some-container">
<div class="main">
<img src="phone.jpg">
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
</div>
<div class="some-container">
<div class="main">
<img src="phone.jpg">
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
</div>
<div class="some-container">
<div class="main">
<img src="phone.jpg">
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
</div>
<div class="clearfix"></div>
</section>
The float cannot work because the elements dont fit into a row. You have set a margin. The complete width of an element is width+margin-left+margin-right. That must be smaller than 50%
Instead of using float everywhere, try using a HTML table, with 2 rows and 2 columns.
<table>
<tr>
<td>img1</td>
<td>img2</td>
</tr>
... etc
</table>
Then set all your table cells to be 50% wide using CSS.
You are using float as well as margin:0 auto replace the main css with the following;
.main{
float:left;
width:50%;
text-align: center;
border:10px solid white;
width:306px;
height:306px;
box-shadow: 0px 0px 25px black;
overflow: hidden;
}
You have added the width twice remove that 306px and give box sizing border-box to make sure that borders are taking from inside see this fiddle https://jsfiddle.net/pwfucx16/
<section class="opportunity">
<div class="main">
<img src="phone.jpg" >
<div class="paragraph">This wil be centered</div>
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
<div class="main">
<img src="phone.jpg">
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
<div class="main">
<img src="phone.jpg">
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
<div class="main">
<img src="phone.jpg">
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
<div class="clearfix"></div>
</section>
Style sheet is
.clearfix{
clear: both;
}
section{
text-align: center;
}
.main{
float:left;
text-align: center;
border:10px solid white;
height:306px;
width:50%;
margin : 50px auto;
box-shadow: 0px 0px 25px black;
overflow: hidden;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.paragraph{
-webkit-transform: translateY(-300%);
border: 5px solid grey;
background-color: grey;
opacity: 0.5;
}
.main:hover .content,
.main:active .content{
-webkit-transform: translateY(-340px);
-webkit-transition: -webkit-transform 700ms;
}
.content{
width: 306px;
height: 306px;
background: rgba(51, 102, 255, 0.5);
}
img{
height:inherit;
width:inherit;
-webkit-transition: -webkit-transform 5000ms;
}
button{
width: 100%;
height: 50px;
margin-top: 100px;
background: black;
border: 0;
cursor: pointer;
color: white;
font: 16px tahoma;
}
button:hover
{
opacity: 0.5;
}
Your main problem is the fact that you have two width properties on the CSS rule for .main. You're setting the width to 50% but then overriding it again a few lines later to a value of 306px:
.main{
float:left;
width:50%;
// ...
width:306px;
// ...
}
Secondly, the 10px border that you're applying to your .main element will not be taken into account when the 50% width is calculated and so your elements will be 20px (2 x 10px) wider than 50%. To fix this, you'll need to set the box-sizing property value to `border-box':
.main {
// ...
-moz-box-sizing: border-box;
box-sizing: border-box;
}
There are a few other kinks to sort out as well but this will solve your requested issue. I'm not sure exactly what you're going for here so when you run into more issues feel free to create another question and link to it here.
Here's a snippet with my proposed fixes to display 2 images in a row:
.clearfix{
clear: both;
}
section{
text-align: center;
}
.main{
float:left;
width:50%;
text-align: center;
border:10px solid white;
height:306px;
margin : 50px auto;
box-shadow: 0px 0px 25px black;
overflow: hidden;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.paragraph{
-webkit-transform: translateY(-300%);
border: 5px solid grey;
background-color: grey;
opacity: 0.5;
}
.main:hover .content,
.main:active .content{
-webkit-transform: translateY(-340px);
-webkit-transition: -webkit-transform 700ms;
}
.content{
width: 100%;
height: 306px;
background: rgba(51, 102, 255, 0.5);
}
img{
height: inherit;
width: inherit;
-webkit-transition: -webkit-transform 5000ms;
}
button{
width: 100%;
height: 50px;
margin-top: 100px;
background: black;
border: 0;
cursor: pointer;
color: white;
font: 16px tahoma;
}
button:hover
{
opacity: 0.5;
}
<section class="opportunity">
<div class="main">
<img src="http://placehold.it/650x350" >
<div class="paragraph">This wil be centered</div>
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
<div class="main">
<img src="http://placehold.it/650x350">
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
<div class="main">
<img src="http://placehold.it/650x350">
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
<div class="main">
<img src="http://placehold.it/650x350">
<div class="content">
<button>Nokia 7210 Classic</button>
</div>
</div>
<div class="clearfix"></div>
</section>
I have two rows of 4-boxed divs. The goal is to have a header within each box, and then hovering over the box will present more detailed p text with a faded background. I'm close, I just can't figure out how to actually layer the span overlay on top of the div instead of it being padded out of the way. Any help would be hugely appreciated!
.box {
width: 200px;
float: left;
box-shadow: inset 1px 1px 40px 0 rgba(90, 90, 90, .25);
margin: 5% auto 0 auto;
background-color: #DE5D40;
background-size: cover;
border-radius: 5px;
overflow: hidden;
}
.overlay {
background: rgba(0, 0, 0, .75);
text-align: center;
padding: 45px 0 66px 0;
opacity: 0;
-webkit-transition: opacity .25s ease;
-moz-transition: opacity .25s ease;
z-index: 10;
}
.box:hover .overlay {
opacity: 1;
}
.overlayText {
font-family: Helvetica;
font-weight: 14;
color: rgba(255, 255, 255, .85);
font-size: 14px;
}
.one-fourth.box {
margin-bottom: 20px;
height: 130px;
}
/* Column Classes
Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css
--------------------------------------------- */
.five-sixths,
.four-sixths,
.one-fourth,
.one-half,
.one-sixth,
.one-third,
.three-fourths,
.three-sixths,
.two-fourths,
.two-sixths,
.two-thirds {
float: left;
margin-left: 2.564102564102564%;
}
.one-half,
.three-sixths,
.two-fourths {
width: 48.717948717948715%;
}
.one-third,
.two-sixths {
width: 31.623931623931625%;
}
.four-sixths,
.two-thirds {
width: 65.81196581196582%;
}
.one-fourth {
width: 23.076923076923077%;
}
.three-fourths {
width: 74.35897435897436%;
}
.one-sixth {
width: 14.52991452991453%;
}
.five-sixths {
width: 82.90598290598291%;
}
.first {
clear: both;
margin-left: 0;
}
<div class="one-fourth first box box1">
<h3>SEO</h3>
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box2">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box3">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box4">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth first box box5">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box6">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box7">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box8">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
Check the code below should be what your after.
They key here is positioning.
What you want is a box that overlays its container and has text in the dead center.
In these instances position:absolute & position:relative mean everything.
A small understanding of relativity would help in this situation but until you crack open a copy of the theory of relativity you can have this.
Your container will be relatively positioned. this means it is positioned relatively to the content surrounding it. But it also has a second cascaded function.
It tell's an absolutely positioned element to behave Absolutely relative to its container.
so when this happens we can use top,bottom,left & right to control where it should sit in the container absolutely.
so what we want to happen is for your text to sit dead center so in this case we tell it to have top,left,bottom & right 0px & margin:auto;
This will tell your element that it is not taking positioning rules from any one point of your container and it wants its marginalizing to be automatically thought out, but since you have defined all the axis that it can be positioned from it will margin it to the center.
Hope it help's you understand a little on why this happens.
.box {
position: relative;
width: 200px;
float: left;
box-shadow: inset 1px 1px 40px 0 rgba(90, 90, 90, .25);
margin: 5% auto 0 auto;
background-color: #DE5D40;
background-size: cover;
border-radius: 5px;
overflow: hidden;
}
.overlay {
top: 0px;
left: 0px;
position: absolute;
background: rgba(0, 0, 0, .75);
text-align: center;
opacity: 0;
-webkit-transition: opacity .25s ease;
-moz-transition: opacity .25s ease;
z-index: 10;
width:100%;
height:inherit;
}
.box:hover .overlay {
opacity: 1;
}
.overlayText {
position: absolute;
margin: auto;
left: 0px;
right: 0px;
top: 0px;
bottom: 0px;
font-family: Helvetica;
font-weight: 14;
color: rgba(255, 255, 255, .85);
font-size: 14px;
height:15px;
}
.one-fourth.box {
margin-bottom: 20px;
height: 130px;
}
/* Column Classes
Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css
--------------------------------------------- */
.five-sixths,
.four-sixths,
.one-fourth,
.one-half,
.one-sixth,
.one-third,
.three-fourths,
.three-sixths,
.two-fourths,
.two-sixths,
.two-thirds {
float: left;
margin-left: 2.564102564102564%;
}
.one-half,
.three-sixths,
.two-fourths {
width: 48.717948717948715%;
}
.one-third,
.two-sixths {
width: 31.623931623931625%;
}
.four-sixths,
.two-thirds {
width: 65.81196581196582%;
}
.one-fourth {
width: 23.076923076923077%;
}
.three-fourths {
width: 74.35897435897436%;
}
.one-sixth {
width: 14.52991452991453%;
}
.five-sixths {
width: 82.90598290598291%;
}
.first {
clear: both;
margin-left: 0;
}
<div class="one-fourth first box box1">
<h3>SEO</h3>
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box2">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box3">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box4">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth first box box5">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box6">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box7">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box8">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
If i understand your problem correctly you need to use position:absolute for your .overlay div to position it on top of your .box div.
You can try this:
.box { position: relative}
.overlay{position:absolute;
top:0px;
left:0px}
Do this:
.box {
position:relative;
}
.overlay {
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
}
JSFIDDLE: http://jsfiddle.net/7zk1bbs2/
If you look at the jsfiddle product you ll see the icons are fitted in an orange box. However, you have to scroll vertically to search through them and im trying to scroll horizontally. How do i do this?
HTML
<!DOCTYPE>
<HTML>
<head>
<meta charset="UTF-8">
<title> My Home Page</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="banner">
<h1> Welcome!<span style="color:#FF009D" class="dot">•</span><span style="color:#12E00B" class="dot">•</span><span style="color:#FF9D00" class="dot">•</span> </h1>
</div>
<div class="wrap">
<div class="item">
<a href="https://www.youtube.com/user/maxxchewning">
<img src="http://i.ytimg.com/vi/HrkZQ3EOmFQ/hqdefault.jpg"/>
<div class="button"></div>
</a>
</div>
<div class="item">
<a href="https://www.youtube.com/user/Christianguzmanfitne">
<img src="http://i.ytimg.com/vi/zsD_7hkfEwY/hqdefault.jpg"/>
<div class="button"></div>
</a>
</div>
<div class="item">
<a href="https://www.youtube.com/user/PhysiquesOfGreatness">
<img src="http://v017o.popscreen.com/VzFBeVBjMHhpRWMx_o_new-physiques-of-greatness-intro-25.jpg"/>
<div class="button"></div>
</a>
</div>
<div class="item">
<a href="https://www.reddit.com">
<img src="https://pbs.twimg.com/profile_images/459083822470946816/VGv0AGio.png"/>
<div class="button"></div>
</a>
</div>
<div class="item">
<a href="https://www.ebay.com">
<img src="https://pbs.twimg.com/profile_images/471350614132129793/NCDCFXva.jpeg"/>
<div class="button"></div>
</a>
</div>
<div class="item">
<a href="https://www.facebook.com">
<img src="https://pbs.twimg.com/profile_images/3513354941/24aaffa670e634a7da9a087bfa83abe6_400x400.png"/>
<div class="button"></div>
</a>
</div>
</div>
<div class="footer"></footer>
</body>
</HTML>
CSS
body {
margin-top:-3px;
}
.banner {
width:100%;
height:200px;
background-color: rgba(64, 201, 255, 1);
margin-left:-10px;
}
h1 {
font-size:80px;
margin-left:30px;
font-family:Futura;
line-height:120px;
color:rgba(255, 255, 255, 1);
text-shadow: 2px 2px 3px rgba(255,255,255,0.1);
width:100%;
letter-spacing:1px;
padding-top:30px;
}
h1:hover {
font-size:80px;
font-family:Futura;
color: rgba(64, 201, 255,.8);
text-shadow: 2px 2px 3px rgba(255, 255, 255,0.9);
width:100%;
padding-top:30px;
}
.wrap{
margin-top:20px;
width: 100%;
background-color: rgba(255, 190, 77, 1);
height:200px;
margin-left:-10px;
overflow:auto;
}
.item {
float:left;
width:25%;
padding:0px;
margin-left: 60px;
margin-top: 20px;
}
.item img {
width:100%;
padding-top:10px;
max-height:100px;
opacity:1;
}
.item img:hover {
opacity:.4;
-webkit-transform: scale(1.2);
-moz-transform: scale(1.2);
-o-transform: scale(1.2);
-ms-transform: scale(1.2);
}
.button {
background-color:rgba(64, 201, 255,1);
height:50px;
width:100%;
border-bottom-right-radius:.5em;
border-bottom-left-radius:.5em;
transition: background-color 0.3s linear;
}
.item:hover .button{
background-color: rgba(255, 0, 157, 1);
-webkit-transform: scale(1.2);
-moz-transform: scale(1.2);
-o-transform: scale(1.2);
-ms-transform: scale(1.2);
}
you change your .wrap class overflow with
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
and change your .item class float with
display: inline-block;
.wrap and item final look like this
.wrap{
margin-top:20px;
width: 100%;
background-color: rgba(255, 190, 77, 1);
height:200px;
margin-left:-10px;
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
}
.item {
display: inline-block;
width:25%;
padding:0px;
margin-left: 60px;
margin-top: 20px;
}
May be your problem is solved
With little tweaks you can do this check the updated fiddle
enter link description here
.wrap-in { width:2000px; }
.item {width:200px}
.wrap{overflow:hidden;overflow-x:scroll;width:960px}
Your h1 is bleeding past the .banner. (in particular, the margin-left on the h1 is causing the page to get a horizontal scroll)
Two solutions:
Have the .banner hide anything beyond its bounding box(http://jsfiddle.net/TheIronDeveloper/7zk1bbs2/3/)
.banner {
overflow:hidden;
}
It kind of looks ugly without additional styling...
Remove the left-margin from the h1 (http://jsfiddle.net/TheIronDeveloper/7zk1bbs2/2/)
h1 {
margin-left: 0;
}
But with this, you lose the padding you were attempting.
Or a combination of the above (I cleaned up the code a little):
http://jsfiddle.net/TheIronDeveloper/7zk1bbs2/4/
Also, as minor css improvement for your fiddle, when using {selector}:hover, you only need to add the css styles that you want changed, you don't have to redefine what already exists with {selector}.
Dont Know what i am missing Please CHeck looking forward to your guideness
here is code
html
<button title="Register" class="bn1">Register</button>
<!--Starting of Modal Making-->
<div id="openModal" class="modalDialog">
<div>
X
<div id="modaltext">
<h2>Regisration Form</h2>
<p></p>
<p>Photopool provides you three packages .....You can Check Our packages Here as Well as You can Join us Free :)</p>
<p>Photopool welcomes You here :)</p>
</div>
</div>
``</div>
<!--Ending of Modal-->
html of below div (join us )
<div id="content">
<div id="textcontent" align="center">
<hgroup id="text">
<p class="line1" style="width:160px;height:28px;">Join Us!! </p><br/>
<p class="line2" style="width:24px;height:19px;"> on</p><br/>
<p class="line3" style="width:150px;height:30px;">Photopool</p> <p class="line31" align=right" style="width:50px;height:20px;"> .com </p><br/>
<p class="line4" style="width:18px;height:30px;">U</p><p class="line41" style="width:69px;height:30px;">pload </p>
<p class="line5" style="width:20px;height:30px;">S</p><p class="line51" style="width:59px;height:30px;">hare </p>
<p class="line6" style="width:20px;height:30px;">D</p><p class="line61" style="width:116px;height:30px;">ownload</p><br/>
<p class="line7" style="width:170px;height:30px;">Photoshoots </p><br/>
<hr/>
<p class="line8" style="width:130px;height:20px;">Check</p><p class="line81" style="width:130px;height:33px;"> HERE</p><br/>
<p class="line9" style="width:200px;height:30px;">Our Exciting</p><br/>
<p class="line10" style="width:194px;height:43px;">Membership</p>
<p class="line11" style="width:80px;height:30px;">Plans</p>
</hgroup>
</div>
CSS of Modal and its div
/MODAL styling/
.modalDialog {
position: fixed;
font-family: Arial, Helvetica, sans-serif;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0,0,0,1.9);
z-index: 99999;
-webkit-transition: opacity 400ms ease-in;
-moz-transition: opacity 400ms ease-in;
transition: opacity 400ms ease-in;
pointer-events: none;
}
.modalDialog:target {
opacity:1;
pointer-events: auto;
}
.modalDialog > div {
width: 400px;
position:relative;
margin: 10% auto;
padding: 5px 20px 13px 20px;
border-radius: 10px;
background: #000000;
background: -moz-linear-gradient(#FFFFFF, #999);
background: -webkit-linear-gradient(#fff, #999);
background: -o-linear-gradient(#fff, #999);
}
css of below div (join us )
#textcontent{
margin-top:1.5%;
float:right;
width: 39%;
height:62%;
margin-right:4%;
transform:rotate(-1deg);
-ms-transform:rotate(-1deg); /* IE 9 */
-webkit-transform:rotate(-1deg); /* Safari and Chrome */
}
#text{
padding-left:24px;
padding-right:27px;
margin-right:5%;
background-color:/*#EED2EE*/#000000;
margin-top: 1.4%;
background:rgba(0, 0, 0, 0.5);
width:75%;
height:95%;
border-radius:10px;
box-shadow: 0 0 1em 0em #ccc;
}
i just want to make this registration form prominant ..SOS !!!
the problem was the z-index ..
Here I've modify a CSS little bit. just remove the z-index:99999 and give the z-index property to div child of div which id is "openModal"
Here is jsfiddle!
I hope this is you are looking for.
When the window is minimized, everything remains intact but not the navigation.
The image below is when the window is maximized and the image above when the window is minimized.
HTML:
<header>
<div class="header">
<div class="logo">
<img src="images/logo.png" />
</div>
<nav>
<div class="navigation">
<a href="home.html">
<div class="box" style="background: rgba(0, 0, 0, 0.4)">
<img src="images/home.png">
<div class="name" style="background: rgba(0, 0, 0, 0.4)">HOME</div>
</div>
</a>
<div class="box">
<img src="images/aboutus.png">
<div class="name">ABOUT US</div>
</div>
<div class="box">
<img src="images/groupcompanies.png">
<div class="name">GROUP OF COMPANIES</div>
</div>
<div class="box">
<img src="images/career.png">
<div class="name">CAREER</div>
</div>
<div class="box">
<img src="images/contactus.png">
<div class="name">CONTACT US</div>
</div>
</div>
</nav>
</div>
</header>
CSS:
body {
background-image:url(images/pattern.png);
min-width: 775px;
overflow:auto;
}
#font-face {
font-family:"myfont";
src:url(font/PTN57F.woff);
}
.header {
max-width:1200px;
min-width:200px;
height:170px;
margin:0 auto;
margin-top:10px;
background-color:rgba(0, 0, 0, 0.5);
border-radius:3px;
}
.logo {
width:230px;
}
.logo img {
margin-left:20px;
margin-top:31px;
border-right:solid #FFF 1px;
padding-right:33px;
height:auto;
width:auto;
float:left;
}
.navigation {
width:800px;
height:100px;
margin-left:256px;
float:none;
}
.box {
height:100px;
width:150px;
margin-right:5px;
float:left;
background: rgba(0, 0, 0, 0.2);
-webkit-transition: background 1s;
-o-transition: background 1s;
-moz-transition: background 1s;
border-radius:2px;
margin-top:31px;
}
.box:hover {
background: rgba(0, 0, 0, 0.4);
-webkit-transition: background 1s;
-o-transition: background 1s;
-moz-transition: background 1s;
}
.name {
height:23px;
width:auto;
text-align:center;
font-family:myfont;
font-size:14px;
color:#FFF;
text-decoration:none;
}
.box img {
float:none;
margin-left:38px;
margin-top:3px;
}
The boxes are inside div.navigation, which has a left margin of 256px. When the div.header resizes, the left margin stays the same. If you want the navigation centered inside the header you can use
.navigation {
margin-left: auto;
margin-right: auto;
}
This way it will not overflow the header div and adjust the left margin according to the overall width.
As of your comment, if you want the header stay the same, you must give it a fixed width, like
.header {
width: 1200px;
}
Then, you also don't need the min-width and max-width.