Issue in css align column count - html

Here is my jsfiddle link: http://jsfiddle.net/m9tk4uex/
The first column is not looking properly, it is something margin-down.
<div class="wrapper">
<h1 class="collection-title">3 Easy Liquid Rubber Solutions For Your Customers</h1>
<div class="main">
<div class="column-1">
<h3>Leaky Barn Roofs</h3>
<img src="leaky-barn-roofs.jpg" alt="" />
<p>Liquid Rubber MetalSafe ...</p>
<img src="img1.jpg" alt="" />
</div>
<div class="column-2">
<h3>Waterproof Planter</h3>
<img src="waterproof-planter.jpg" alt="" />
<p>Simple and easy to do...</p>
<img src="img2.jpg" alt="" />
</div>
<div class="column">
<h3>RV Roof Repair Boxes</h3>
<img src="rv-roof-repair-boxes.jpg" alt="" />
<p>You may be surprised...</p>
<img src="img3.jpg" alt="" />
</div>
</div>
</div>
I need something like this http://s23.postimg.org/xghd34xbf/Untitled_1_copy.png
May i know how to fix this? and how to add border right to each column?
Thanks.

One solution is to add display: inline-block to all div inside div with class .main:
div.main > div {
display: inline-block;
}
Additional you can add min-height to p elements to align properly:
div.main div[class^=column] p {
min-height: 170px;
}
body {
background-color: #222222;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #fff;
}
.wrapper {
width: 960px;
margin-left: auto;
}
#header {
position: relative;
letter-spacing: 1px;
height: 148px;
padding-top: 19px;
padding-bottom: 0px;
background: url("//cdn.shopify.com/s/files/1/0334/3241/t/3/assets/header-bg.png?7423127476356136057") no-repeat scroll 0% 0% transparent;
}
#cart-login {
float: right;
}
.cart-elem {
display: block;
font-size: 24px;
color: #fff;
margin: 0px;
position: relative;
top: 5px;
}
.main {
-webkit-column-count: 3;
/* Chrome, Safari, Opera */
-moz-column-count: 3;
/* Firefox */
column-count: 3;
}
.collection-title {
color: #C5C5C5;
font-size: 28px;
line-height: 28px;
margin: 15px 0px 16px;
font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 400;
padding-bottom: 20px;
}
div.main > div {
display: inline-block;
}
div.main div[class^=column] p {
min-height: 170px;
}
<div class="wrapper">
<h1 class="collection-title">3 Easy Liquid Rubber Solutions For Your Customers</h1>
<div class="main">
<div class="column-1">
<h3>Leaky Barn Roofs</h3>
<img src="http://s2.postimg.org/4zex34qw5/leaky_barn_roofs.jpg" alt="" />
<p>Liquid Rubber MetalSafe Sealants provide corrosion protection, waterproofing and color restoration to aged rusting steel barn roofs, outlastingtypical barn roof paints for years. Our self priming coatings require only a washed surface without the
removal of any rust and can be applied with a brush, roller or paint sprayer. Standard & custom color top-coats are available.</p>
<img src="http://s17.postimg.org/3uwizx25r/img1.jpg" alt="" />
</div>
<div class="column-2">
<h3>Waterproof Planter</h3>
<img src="http://s2.postimg.org/4zex34qw5/leaky_barn_roofs.jpg" alt="" />
<p>Simple and easy to do. Waterproof and preserve your wood planter boxes. Untreated wood planter boxes start to decay from the harmful effects of water and ultraviolet light. Two thick coats of Liquid Rubber Waterproof Sealant will provide long lasting
and full protection that will secure your planter boxes for years to come.</p>
<img src="http://s17.postimg.org/3uwizx25r/img1.jpg" alt="" />
</div>
<div class="column">
<h3>RV Roof Repair Boxes</h3>
<img src="http://s2.postimg.org/4zex34qw5/leaky_barn_roofs.jpg" alt="" />
<p>You may be surprised at how inexpensive and simple it can be to repair an RV, motor home or camper yourself. Using a combination of Liquid Rubber Smooth Sealant and Liquid Rubber Seam Tape, any do-it-yourself customer can seal a leaky roof, whether
it's made of EPDM, TPO, fiberglass or aluminum.</p>
<img src="http://s17.postimg.org/3uwizx25r/img1.jpg" alt="" />
</div>
</div>
</div>

.main div h3:nth-child(1){margin-top: 0;}

Please update this code
body {
background-color:#222222;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
color:#fff;
}
.wrapper {
width:960px;
margin-left:auto;
}
#header {
position: relative;
letter-spacing: 1px;
height: 148px;
padding-bottom: 0px;
background: url("//cdn.shopify.com/s/files/1/0334/3241/t/3/assets/header-bg.png?7423127476356136057") no-repeat scroll 0% 0% transparent;
}
#cart-login {
float: right;
}
.cart-elem {
display: block;
font-size: 24px;
color: #fff;
margin: 0px;
position: relative;
top: 5px;
}
.main {
-webkit-column-count: 3; /* Chrome, Safari, Opera */
-moz-column-count: 3; /* Firefox */
column-count: 3;
-webkit-column-rule: 4px outset #ff00ff; /* Chrome, Safari, Opera */
-moz-column-rule: 4px outset #ff00ff; /* Firefox */
column-rule: 4px outset #ff00ff;
}
.collection-title {
color: #C5C5C5;
font-size: 28px;
line-height: 28px;
margin: 15px 0px 16px;
font-family: "Lato","Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight: 400;
padding-bottom: 20px;
}
h3{margin: 0 0 10px;}
<div class="wrapper">
<h1 class="collection-title">3 Easy Liquid Rubber Solutions For Your Customers</h1>
<div class="main">
<div class="column-1">
<h3>Leaky Barn Roofs</h3>
<img src="http://s2.postimg.org/4zex34qw5/leaky_barn_roofs.jpg" alt="" />
<p>Liquid Rubber MetalSafe Sealants provide corrosion protection, waterproofing and color restoration to aged rusting steel barn roofs, outlastingtypical barn roof paints for years. Our self priming coatings require only a washed surface without the removal of any rust and can be applied with a brush, roller or paint sprayer. Standard & custom color top-coats are available.</p>
<img src="http://s17.postimg.org/3uwizx25r/img1.jpg" alt="" />
</div>
<div class="column-2">
<h3>Waterproof Planter</h3>
<img src="http://s2.postimg.org/4zex34qw5/leaky_barn_roofs.jpg" alt="" />
<p>Simple and easy to do. Waterproof and preserve your wood planter boxes. Untreated wood planter boxes start to decay from the harmful effects of water and ultraviolet light. Two thick coats of Liquid Rubber Waterproof Sealant will provide long lasting and full protection that will secure your planter boxes for years to come.</p>
<img src="http://s17.postimg.org/3uwizx25r/img1.jpg" alt="" />
</div>
<div class="column">
<h3>RV Roof Repair Boxes</h3>
<img src="http://s2.postimg.org/4zex34qw5/leaky_barn_roofs.jpg" alt="" />
<p>You may be surprised at how inexpensive and simple it can be to repair an RV, motor home or camper yourself. Using a combination of Liquid Rubber Smooth Sealant and Liquid Rubber Seam Tape, any do-it-yourself customer can seal a leaky roof, whether it's made of EPDM, TPO, fiberglass or aluminum.</p>
<img src="http://s17.postimg.org/3uwizx25r/img1.jpg" alt="" />
</div>
</div>
</div>

.column-1,.column-2,column{
-webkit-column-break-inside: auto;
}

Related

Struggling to get words and Images inline

enter image description hereI am trying to get text underneath the images and have the images inline, I am getting them in line to make a slide show. Please see my code below
HTML:
<div class="slideshow-container">
<div class="mySlides fade">
<img src="images/British citizenship and Immigration.jpg" alt="British citizenship and Immigration Images">
<div class="text"><h6>British citizenship and
Immigration
</h6>
</div>
<div class="mySlides fade">
<img src="images/Australian Migration.jpg" alt="Australian Migration Images">
<div class="text"><h6>Australian Migration</h6>
<p class = "sent">Our team can assist with a range of Australian visa solutions. Our expert knowledge ensures you receive the best advice for your personal circumstances. </p>
</div>
</div>
<img src="images/Citizenship by investment.jpg" alt="Australian Migration Images">
<div class="text"><h6>Citizenship-by-investment</h6>
<p class = "sent">Enjoy the exclusive privileges that dual citizenship and international investment can provide. Our consultants can help you select the right programme and guide you every step of the way. </p>
</div>
<a class="prev" onclick="plusSlides(-1)">❮</a>
<a class="next" onclick="plusSlides(1)">❯</a>
</div>
</div>
CSS
.slideshow-container {
max-width: 1000px;
position: relative;
margin: auto;
}
.mySlides
{
display: flex;
}
I have tried display grid with grid-template-columns, the text does not go underneath and that does not seem to work.
Anyone have a solution?
Try to add display: inline-block on the actual Elements( that is the image and the word)
I managed to get it in line with the text underneath.
HTML
<div class="row">
<div class="column animation">
<img src="images/British citizenship and Immigration.jpg" alt="British citizenship and Immigration">
<h1>British citizenship and Immigration</h1>
</div>
<div class="column">
<img src="images/Australian Migration.jpg" alt="Australian Migration">
<h1>Australian Migration</h1>
<p>Our team can assist with a range of Australian visa solutions. Our expert knowledge ensures you receive the best advice for your personal circumstances.</p>
</div>
<div class="column">
<img src="images/Citizenship by investment.jpg" alt="Citizenship by investment">
<h1>Citizenship-by-investment</h1>
<p>Enjoy the exclusive privileges that dual citizenship and international investment can provide. Our consultants can help you select the right programme and guide you every step of the way.</p>
</div>
<a class="prev" onclick="plusSlides(-1)">❮</a>
<a class="next" onclick="plusSlides(1)">❯</a>
</div>
CSS
.row {
margin-top: 10px;
display: flex;
flex-wrap: wrap;
padding: 0px 8rem 0px 338px;
margin-top: -33vh;
margin-left:10vw;
}
.column {
flex:10%;
padding: 0 4px;
}
.prev, .next {
cursor: pointer;
position: relative;
top: 50%;
width: auto;
margin-top: -22px;
padding: 16px;
color: #115577;
font-weight: bold;
font-size: 30px;
transition: 0.6s ease;
border-radius: 0 3px 3px 0;
user-select: none;
}
.next {
text-decoration: none;
top:7rem;
right: 26rem;
border-radius: 3px 0 0 3px;
}
.prev
{
text-decoration: none;
top:7rem;
left: -126rem;
}
.column h1
{
font-size:16px;
margin-left: 2.5rem;
}
.column img
{
margin-left:1vw;
}
.column p
{
text-align: center;
margin-left: 0rem;
margin-right: 25rem;
}
.animation {
animation-name: animation;
animation-duration: 1.5s;
}
#keyframes animation {
from {opacity: .4}
to {opacity: 1}
}
Thank you all for your help

Changing line height without affecting the background color

I'm currently working on freecodecamp's first test, so my question is probably dumb. I would like to change the line-height of #titles to a smaller one, while keeping it's background color. It's probably the display element, but I can't figure out what to do. Also, I'd like to get rid of the white line surrounding my image, right before the border...
<div id="main">
<div id="titles">
<h1 id="title">A tribute to Ocelote</h1>
<h2 id="title2">The man who has done it all.</h2>
</div>
<hr>
<div id="img-div">
<img id="image" src="https://theshotcaller.net/wp-content/uploads/2017/09/IMG_5488-1.jpg" alt="A photo of Ocelote">
<div id="img-caption"> A story of how far can one go, if only the desire is
there.
</div>
<div id="tribute-info">
<br>
<br>
fgj
</div>
<a id="tribute-link" href="https://lol.gamepedia.com/Ocelote" target="_blank"> </a>
</div>
</div>
https://jsfiddle.net/deffciu/hrna0Lfs/
any help is appreciated
Adding the below two rules to #titles makes it work:
#titles {
display: block;
background: #6C7E95;
line-height: 5px;
/* Add the below two rules */
overflow: hidden;
padding: 0 0 20px;
}
You get this:
Snippet
html, body {
font-family: 'Oswald', sans-serif;
text-align: center;
background: white;
}
#title2 {
color: #052449;
margin-bottom: 0px;
}
#titles {
display: block;
background: #6C7E95;
line-height: 5px;
/* Add the below two rules */
overflow: hidden;
padding: 0 0 20px;
}
#image {
border: 8px solid #052449;
border-radius: 50%;
width: 500px;
height: 375px;
margin-top: 15px;
}
hr {
border-color: #486282;
margin-top:0px;
}
#img-caption {
margin-top: 20px;
font-style: italic;
font-size: 25px;;
}
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
<div id="main">
<div id="titles">
<h1 id="title">A tribute to Ocelote</h1>
<h2 id="title2">The man who has done it all.</h2>
</div>
<hr>
<div id="img-div">
<img id="image" src="https://theshotcaller.net/wp-content/uploads/2017/09/IMG_5488-1.jpg" alt="A photo of Ocelote">
<div id="img-caption"> A story of how far can one go, if only the desire is there.
</div>
<div id="tribute-info">
<br>
<br>
fgj
</div>
<a id="tribute-link" href="https://lol.gamepedia.com/Ocelote" target="_blank"> </a>
</div>
</div>
For the white border issue, it's your body's margins. The below code will fix it.
body {margin: 0;}

Footer Widgets not lining up in Wordpress

I have created a child theme of Twenty Thirteen and am doing some updates to it. I have a dev site that is pretty much a copy of the live site. The only thing that I changed in the footer area is the widget title styles but I can't get the 3 widgets to line up. I currently have 2 on the first line and 1 down below. It doesn't seem to matter if I change the container width.
Here is the new version of the site: http://dev.unitedconstruction.com/
Here is the old site that still works:http://unitedconstruction.com/
Can anyone see where my problem is?
CSS (most of what pertains to the footer)
/* FOOTER */
.site-footer .sidebar-container, .site-footer {
background-color: #fff; /*#C6C6C7;*/
}
.site-footer .sidebar-container {
min-height: 335px;
padding: 20px 0 0;
border-top: 0 solid #0069AA;
}
.site-footer .widget{
width: 100% !important;
max-width: 333px !important;
border-bottom: 5px solid #0069AA;
background-color: #fff;
min-height: 358px;
float:left;
font-size: 14px;
margin: 0 0 24px;
padding: 0 0 10px 0;
word-wrap: break-word;
color: #333;
}
.widget .widget-title {
font: normal 24px Arial, Helvetica, sans-serif;
margin: 0;
}
.site-footer .widget-title, .site-footer .widget-title a, .site-footer .wp-caption-text {
font: normal 24px 'Open Sans', Arial, Helvetica, sans-serif;
color: #000;
background-color: transparent;
margin: 0;
padding: 5px 0;
border-bottom:2px solid #FDFDFD;
word-spacing:0;
text-transform: capitalize;
}
.site-footer .widget-title span{
color: #000;
font-weight:normal;
}
.site-footer .widget li {
padding:0 0 10px;
}
HTML
<footer role="contentinfo" class="site-footer" id="colophon">
<div role="complementary" class="sidebar-container" id="secondary">
<div class="widget-area masonry" style="position: relative; height: 399px;">
<aside class="widget widget_flexible-recent-posts-widget masonry-brick" id="flexible-recent-posts-widget-3" style="position: absolute; left: 0px; top: 0px;"><div class="frp-widget-wrapper frp-widget-">
<div class="frp-clear"></div>
<ul class="frp-widget">
<li class="frp-news">
<h3 class="widget-title"><span>united</span> news</h3>
<div class="frp-clear"></div>
<div class="frp-left">
<img width="333" height="200" alt="United Construction" class="attachment-333x333 wp-post-image" src="http://unitedconstruction.com/wp-content/uploads/2015/12/featured-image-Phase-II-Groundbreaking.jpg">
</div>
<div class="news-widget-info">
<div class="news-widget-title">
<a class="news-widget-link" href="http://unitedconstruction.com/united-celebrates-groundbreaking-for-new-1-6-million-sf-business-park/">United Celebrates Groundbreaking for New 1.6 Million SF Industrial Park</a>
</div>
<div class="arpw-summary">UC breaks ground on new industrial park in North Reno. The first tenant, Jarden Technical Apparel, consisting of Marmot and ExOfficio, is pre-leasing 270,000 SF</div>
</div>
<div class="frp-clear"></div>
</li>
</ul>
<div class="frp-all-category-news frp-all-category-news-footer">read more >></div>
</div>
</aside><aside class="widget arpw_widget random-posts masonry-brick" id="arpw_widget-2" style="position: absolute; left: 353px; top: 0px;">
<h3 class="widget-title"><span>united</span> projects</h3>
<div class="arpw-block">
<ul>
<li class="arpw-clearfix">
<a rel="bookmark" title="Permalink to Lake Washington Partners – SanMar Distribution Center" href="http://unitedconstruction.com/otw-portfolio/lake-washington-partners-sanmar-distribution-center-showroom/">
<img width="333" height="200" title="Lake Washington Partners – SanMar Distribution Center" alt="Lake Washington Partners – SanMar Distribution Center" class="arpw-alignleft wp-post-image" src="http://unitedconstruction.com/wp-content/uploads/2015/06/featured-image-sanmar.jpg"> </a>
<h3 class="arpw-title">
<a rel="bookmark" title="Permalink to Lake Washington Partners – SanMar Distribution Center" href="http://unitedconstruction.com/otw-portfolio/lake-washington-partners-sanmar-distribution-center-showroom/">Lake Washington Partners – SanMar Distribution Center</a>
</h3>
<div class="arpw-summary">621,738 SFt build-to-suit distribution center features automated…</div>
</li>
</ul>
<div class="frp-all-category-news frp-all-category-news-footer"> <a title="See More United Construction Projects" href="?page_id=32">read more >></a> </div>
</div><!-- .arpw-block - http://wordpress.org/plugins/advanced-random-posts-widget/ -->
</aside><aside class="widget widget_flexible-recent-posts-widget masonry-brick" id="flexible-recent-posts-widget-2" style="position: absolute; left: 706px; top: 0px;"><div class="frp-widget-wrapper frp-widget-">
<div class="frp-clear"></div>
<ul class="frp-widget">
<li class="frp-news">
<h3 class="widget-title"><span>united</span> community</h3>
<div class="frp-clear"></div>
<div class="frp-left">
<img width="333" height="200" alt="Thank You STEP2" class="attachment-333x333 wp-post-image" src="http://unitedconstruction.com/wp-content/uploads/2015/12/featured-image-STEP2-Thank-you.jpg">
</div>
<div class="news-widget-info">
<div class="news-widget-title">
<a class="news-widget-link" href="http://unitedconstruction.com/honored-by-step2-recognition/">Honored by STEP2 Recognition</a>
</div>
<div class="arpw-summary">United Construction is honored by STEP2's acknowledgement during the recent Homes For The Holiday event.</div>
</div>
<div class="frp-clear"></div>
</li>
</ul>
<div class="frp-all-category-news frp-all-category-news-footer">read more >></div>
</div>
</aside> </div><!-- .widget-area -->
</div><!-- #secondary -->
</footer>
One major difference I'm noticing is that the height on your widget area div (class="widget-area masonry") is different.
The broken site has div height of height: 764px while the functioning site has height: 382px.
This is giving the three divs room to stack ontop of each other.

Social media buttons won't fit in the navigation area

Hey everyone I am having an issue where my social media buttons for my website are not staying in the nav header area. I have tried using the float attribute and it wont stay in the header here are some images to show you what I am talking about.
http://imgur.com/zwmtXju
as you can see in this image the social media buttons wont stay in the header area, any help would be appreciated. Thanks in advance.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/jquery-2.1.1.min.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<div id="container">
<header>
<nav class="clearfix">
<a href="#" id="brand">
<h1>Skull</h1>
</a>
<ul class="clearfix">
<li>Moonshine</li>
<li>Recipes</li>
<li>The Blog</li>
<li>The Store</li>
<div id="socialMedia">
<img src="imgs/fbsm.png" alt=""/>
<img src="imgs/tsm.png" alt=""/>
<img src="imgs/psm.png" alt=""/>
</div>
</ul>
Skull®
</nav>
</header>
<div id="content">
<div id="story">
<p id="ourStory">Our Story</p>
<h1 id="bootleg">Bootlegging</h1>
<p id="storyBoard">
<span class="storyTelling">This is our history,</span>
<span class="storyTelling">our story,</span>
<span class="storyTelling">of how we became one of the greatest</span>
<span class="storyTelling">moonshine brands on the planet.</span>
<span class="storyTelling">A story of struggle,</span>
<span class="storyTelling">and independence,</span>
<span class="storyTelling">accompanied by expert craftmanship.</span>
<span class="storyTelling">Using years as chapters of our book of life</span>
<span class="storyTelling">we will show you what makes our moonshine so great.</span>
<span class="storyTelling">Scroll down and enjoy.</span>
</p>
</div>
<div id="timeLine">
<div id="present">
<h1>Here and Now</h1>
<p>Now in 2014 we are a globally recognized brand that many people know and love. </p>
<img src="imgs/skullBrand.png" alt=""/>
</div>
<div id="2000">
<h1>2000</h1>
<p>In 2000, bars started buying our moonshine to make drinks with. This was a huge milestone for Skull®
Because, it brought our brand to the attention of many people that were not yet customers of our great alcohol. </p>
<img src="imgs/skullBrand.png" alt=""/>
</div>
<div id="1960">
<h1>1960</h1>
<p>By 1960 we were booming with popularity. Skull alcohol became a recognized brand.</p>
<img src="imgs/skullBrand.png" alt=""/>
</div>
<div id="1933">
<h1>1933</h1>
<p>By 1933 Prohibition was repealed, and the market grew thin. But that didn't stop us. Skull alcohol was born.
With our superior craftsmanship skills, and our excellent customer satisfaction our legacy continued</p>
<img src="imgs/prohibitionends.jpg" width="263" height="185" alt=""/>
</div>
<div id="1920">
<h1>1920</h1>
<p>By the early 1900s, states began passing laws that banned alcohol sales, and consumption. in 1920,
nationwide Prohibition went in to effect. It was the greatest thing moonshiners could have asked for.
Because there was no legal alcohol available, the demand for moonshine shot up like a rocket. Moonshiners
had so much business they couldn't even keep up with the demand. Hidden saloons called speakeasies were even
opened in every city. they were used to sell the illegal whisky.</p>
<img src="imgs/dry.jpg" height="200" alt=""/>
</div>
<div id="1860">
<h1>1860</h1>
<p>The hatred from the Whisky Rebellion escalated in to the 1860s as the government continued
to try and collect excise tax to fund the Civil War. At this time Moonshiners and many other anti-governmental
groups, such as the KKK, joined forces to kill anyone who would release the location of their stills and attack IRS officials and
their families.</p>
<img src="imgs/kkk.jpg" width="263" height="185" alt=""/>
</div>
<div id="1794">
<h1>1794</h1>
<p>The American people, who had just fought a war to get out from under oppressive British taxes
(among other things), were not particularly pleased. So, they decided to just keep making their own
whisky, completely ignoring the federal tax. All the resentment that the citizens had toward the
government eventually exploded when several hundred angry citizens took over the city of Pittsburgh,
Pennsylvania. President George Washington called apon the militia, a group of 13,000 troops to disperse
The angry mob. The Whiskey Rebellion was a failure.</p>
<img src="imgs/wr.jpg" alt=""/>
</div>
<div id="1791">
<h1>1791</h1>
<p>Moon shining began very early in American history. Shortly after the Revolution,
the United States found itself struggling to pay for the expense of fighting a long war.
The solution was to place a federal tax on liquors and spirits that would soon be known
as the whisky tax.</p>
<img src="" alt=""/>
</div>
</div>
</div>
<footer>
<div class="footerContent"></div>
<div class="footerContent"></div>
<div class="footerContent"></div>
</footer>
</div><!--containerEnd-->
</body>
</html>
/* Clearfix */
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
body {
width: 1920px;
background-color: #202021;
}
#container{
width: 100%;
margin: 0;
background: url('../imgs/565.jpeg') repeat-y center center fixed ;
}
header{
width: 100%;
height: 100px;
}
nav{
width: 100%;
height: 100px;
position: relative;
border-bottom: 2px solid #cccccc;
}
#brand{
margin-top:15px;
width: 250px;
height: 70px;
float: left;
background: url('../imgs/skullAlcoholText.png') no-repeat;
}
#brand h1{
display: none;
}
nav ul{
padding: 0;
margin: 0 auto;
width: 600px;
height: 100px;
list-style: none;
color: #fff;
border-bottom: 2px solid #cccccc;
}
nav li{
display: inline;
float: left;
}
nav a{
color: #fff;
display:inline-block;
width: 150px;
text-align: center;
text-decoration: none;
line-height: 100px;
}
nav li a{
border-right: 1px solid #cccccc;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
nav li:first-child a{
border-left: 1px solid #cccccc;
}
nav a:hover, nav a:active {
color: #ffffff ;
}
#socialMedia{
width: 320px;
float: right;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
#socialMedia a:first-child{
}
#socialMedia a{
width: 100px;
}
nav a#pull {
display: none;
}
#content {
text-align: center;
}
#story{
margin: auto;
line-height: 2;
width: 300px;
height: 200px;
}
#ourStory, #bootleg, #storyBoard{
text-align: center;
color: #ffffff;
}
Your nav ul width is 600px. It's too small to contain all these elements. Therefore div is on next row. I also prefer to change div on something more semantic, like ul.
Put your code in table
<table width="646" border="0">
<tr><td width="98"><ul class="clearfix"><li>Moonshine</li></td><td width="82"><li>Recipes</li></td><td width="88"><li>The Blog</li></td><td width="110"><li>The Store</li></td>``<td width="78"><div id="socialMedia"><img src="imgs/fbsm.png" alt=""/></div></td><td width="78"><div id="socialMedia"><img src="imgs/tsm.png" alt=""/></div></td><td width="82"><div id="socialMedia"><img src="imgs/psm.png" alt=""/></div></td></tr></table></ul>

Align image on left and text on right using css

I need to align image on left and text on right. I am using the following css.
body {} #slideshow-nav {
width: 700px;
height: 30px;
position: absolute;
z-index: 999;
bottom: 0;
left: 11px;
text-align: center;
text-decoration: none;
}
#slideshow-nav a {
background: transparent url('../Image/bullet_grey - 1.png') 0 0 no-repeat;
width: 26px;
height: 26px;
text-indent: -999px;
display: inline-block;
text-decoration: none;
margin: 7px;
text-indent: -9999px !important;
margin: 7px;
text-decoration: none;
background-position: center;
border: none;
outline: none;
}
#slideshow-nav a.activeSlide {
background-position: 0 -1000px;
background: transparent url('../Image/bullet_red.png') 0 0 no-repeat;
display: inline-block;
background-position: center;
text-decoration: none;
border: none;
outline: none;
}
.page-slideshow {
position: relative;
margin-bottom: 15px;
text-decoration: none;
background: #d4ecef;
}
.page-slideshow.narrow #slideshow-nav {
width: 460px;
left: 0;
text-decoration: none;
}
.di-hero {
background: transparent;
width: 718px;
height: 300px;
background-position: 11px 0;
background-repeat: no-repeat;
}
p.more {
margin: 8px 0 0 0;
float: right;
overflow: hidden;
color: #BC1E04;
text-decoration: none;
color: #bc1e04;
margin: 5px 0 0 0;
text-align: center;
float: right;
}
h3 {
display: block;
color: #514c44;
font: 18px/24px Georgia, "Times New Roman", Palatino, "Palatino Linotype", "Book Antiqua", serif;
margin: 0 0 10px 0;
float: right;
overflow: hidden;
text-decoration: none;
margin: 5px 0 0 0;
text-align: center;
float: right;
}
div.slide-content img {
margin: 0 20px 0 0;
border: 5px solid #5999a2;
}
p {
color: #2e2e2a;
margin: 0 0 10px 0;
float: right;
overflow: hidden;
text-decoration: none;
font: 12px/18px Helvetica, "Lucida Sans", "Trebuchet MS", Arial, Verdana, sans-serif;
text-align: center;
float: right;
}
p.more:hover {
text-decoration: underline;
}
.slide-content {
width: 718px;
height: 300px;
background-position: 11px 0;
background-repeat: no-repeat;
}
<div class="page-slideshow narrow">
<div class="hero di-hero">
<div>
<a href="" title="Delicious Ideas from AllRecipes.com">
<div class="slide-content">
<img src="" width="152" height="150" alt="Delicious Ideas from AllRecipes.com">
<h3>Delicious Ideas from AllRecipes.com</h3>
<p>BI-LO has teamed up with AllRecipes.com to provide enhanced recipe searches, regionally inspired recipes, ratings, videos and more.</p>
<p class="more">Find the perfect recipe</p>
</div>
</a>
</div>
<div>
<a href="" title="Meal Planning Made Simple">
<div class="slide-content">
<img src="." width="152" height="150" alt="Meal Planning Made Simple">
<h3>Meal Planning Made Simple</h3>
<p>Whether you're preparing a romantic valentine's dinner or having friends over to watch the big game, our meal planning guide can help.</p>
<p class="more">Start planning today</p>
</div>
</a>
</div>
<div>
<a href="" title="Improve Your Wine & Beer IQ">
<div class="slide-content">
<img src="" width="152" height="150">
<h3>Improve Your Wine & Beer IQ</h3>
<p>The right glass of wine or beer can turn a good meal into a great one. Let us help you take the mystery out of beer and wine shopping.</p>
<p class="more">Learn the basics of wine and beer</p>
</div>
</a>
</div>
<div>
<a href="" title="Learn How to Pick the Perfect Meat">
<div class="slide-content">
<img src="." width="152" height="150" alt="Learn How to Pick the Perfect Meat">
<h3>Learn How to Pick the Perfect Meat</h3>
<p>We’ve got all of the information you need to help you choose the right type of meat for your meal.</p>
<p class="more">See our meat and seafood guide</p>
</div>
</a>
</div>
</div>
<div id="slideshow-nav">
<div>
</div>
</div>
</div>
Now my image is on the Left and text on the right. But it is not properly aligned. I need text on the same line and on the right to the image. Which style element is missing ..? please help me.
Here is the fiddle link
just added following css
.imgDes {
margin-left: 180px;
overflow: hidden;
text-align: left;
}
.imgDes p {
text-align: right;
}
<div class="slide-content">
<img src="http://static.adzerk.net/Advertisers/fdec4733b4814d9e958b7f86c25020b5.jpg" width="152" height="150" alt="Delicious Ideas from AllRecipes.com">
<div class="imgDes">
<h3>Delicious Ideas from AllRecipes.com</h3>
<p>BI-LO has teamed up with AllRecipes.com to provide enhanced recipe searches, regionally inspired recipes, ratings, videos and more.</p>
<p class="more">Find the perfect recipe</p>
</div>
</div>
I'm not sure if this actually helps you but here is how I probably would have done it:
.container {
width:500px;
}
.imageclass {
float:left;
width:200px;
height:20px;
}
.textclass {
float:left;
width:300px;
height:20px;
}
<div class="container">
<p class="imageclass"><img src... /></p>
<p class="textclass">text...</p>
</div>
I used this exact code in one page I did, and it worked fine getting the paragraphs in the same line. You can probably change the paragraphs for divs, and you of course have to change the numbers so it fits on your page.
<table width="100%">
<tr>
<td align="left" valign="top">image</td>
<td align="left" valign="top">text</td>
</tr>
</table>
this way the text and the picture are in the same line
You could allways use tables in divs (Fiddle example here) like this:
<div class="page-slideshow narrow">
<div class="hero di-hero">
<div>
<a href="" title="Delicious Ideas from AllRecipes.com">
<div class="slide-content">
<table>
<tr>
<td>
<img src="" width="152" height="150" alt="Delicious Ideas from AllRecipes.com" style="float:left" >
</td>
<td>
<h3>Delicious Ideas from AllRecipes.com</h3>
<p>BI-LO has teamed up with AllRecipes.com to provide enhanced recipe searches, regionally inspired recipes, ratings, videos and more.</p>
<p class="more">Find the perfect recipe</p>
</td>
</tr>
</table>
</div>
</a>
</div>
<div>
<a href="" title="Meal Planning Made Simple">
<div class="slide-content">
<table>
<tr>
<td>
<img src="." width="152" height="150" alt="Meal Planning Made Simple" style="float:left">
</td>
<td>
<h3>Meal Planning Made Simple</h3>
<p>Whether you're preparing a romantic valentine's dinner or having friends over to watch the big game, our meal planning guide can help.</p>
<p class="more">Start planning today</p>
</td>
</tr>
</table>
</div>
</a>
</div>
<div>
<a href="" title="Improve Your Wine & Beer IQ">
<div class="slide-content">
<table>
<tr>
<td>
<img src="" width="152" height="150" style="float:left" >
</td>
<td>
<h3>Improve Your Wine & Beer IQ</h3>
<p>The right glass of wine or beer can turn a good meal into a great one. Let us help you take the mystery out of beer and wine shopping.</p>
<p class="more">Learn the basics of wine and beer</p>
</td>
</tr>
</table>
</div>
</a>
</div>
<div>
<a href="" title="Learn How to Pick the Perfect Meat">
<div class="slide-content">
<table>
<tr>
<td>
<img src="." width="152" height="150" alt="Learn How to Pick the Perfect Meat">
</td>
<td>
<h3>Learn How to Pick the Perfect Meat</h3>
<p>We’ve got all of the information you need to help you choose the right type of meat for your meal.</p>
<p class="more">See our meat and seafood guide</p>
</td>
</tr>
</table>
</div>
</a>
</div>
</div>
<div id="slideshow-nav">
<div>
</div>
</div>
</div>