css - margin / padding not working -
i have 2 main divs within main div. i've tried adding margin , padding large number test, work work. why can't add margin / padding between them? please help.
html
<div id="mainwrapper"> <header class="container"> <div id="nav2" class="container"> <ul class="nav2a"> <li><a href="#">login</a></li> <li><a href="#">quick search</a></li> <li><a href="#">advanced search</a></li> <li><a href="#">english <i class="fa fa-caret-down"></i></p></a> <ul class="nav2b"> <li><a href="#">french</a></li> <li><a href="#">italian</a></li> <li><a href="#">spanish</a></li> <li><a href="#">german</a></li> </ul> </li> </ul> </div> <!-- end nav2 --> </header> <div class="clearfloat"></div> <div id="fullnav" class="container"> <div id="logosymbol"> <a href="#"> <img src="images/gpj-baker-symbol.png" width="54" height="51" /> </a> </div> <div id="logotext"> <a href="#"> <img src="images/gpj-baker-text.png" width="200" height="30" /> </a> </div> <div class="clearfloat"></div> <div id="mainnav"> <ul class="nav1a"> <li><a href="#">brands</a></li> <li><a href="#">fabrics & wallcoverings</a></li> <li><a href="#">contact</a></li> <li><a href="#">about us</a></li> <li><a href="#">where buy</a></li> <li><a href="#">press</a></li> </ul> </div> <div class="clearfloat"></div> <div class="hr"><hr/></div> <div class="clearfloat"></div> </div> <!-- end fullnav --> <div class="clearfloat"></div> <div id="brandcontainer" class="container"> <div id="breadcrumbs" class="container"> <ul class="breadinfo"> <li><a href="#">home</a></li> <li><a href="brands.html" class="currentpg">brands</a></li> </ul> </div> <!-- end breadicrumbs --> <div class="clearfloat"></div> <div class="brandlist"> <div class="brandimg"> <a href="#"><img src="http://placehold.it/442x294" /></a> </div> <div class="brandcopy"> <a href="#"> <img src="images/gpj-baker-text.png" width="162" height="25" /> </a> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. integer dui ex, pharetra commodo maximus, luctus id ligula. curabitur tempus arcu ac orci fringilla varius.</p> <p>cras hendrerit, mi interdum varius luctus, nisl lectus accumsan mauris, eu tristique arcu massa et arcu. vivamus venenatis purus blandit, placerat urna eget, faucibus mauris.</p> <a href="#">explore <i class="fa fa-caret-right"></i></a> </div> </div> <!-- end brandlist --> <div class="clearfloat"></div> <div class="brandlist"> <div class="brandimg"> <a href="#"><img src="http://placehold.it/442x294" /></a> </div> <div class="brandcopy"> <a href="#"> <img src="images/gpj-baker-text.png" width="162" height="25" /> </a> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. integer dui ex, pharetra commodo maximus, luctus id ligula. curabitur tempus arcu ac orci fringilla varius.</p> <p>cras hendrerit, mi interdum varius luctus, nisl lectus accumsan mauris, eu tristique arcu massa et arcu. vivamus venenatis purus blandit, placerat urna eget, faucibus mauris.</p> <a href="#">explore <i class="fa fa-caret-right"></i></a> </div> </div> <!-- end brandlist --> </div><!-- end brandcontainer -->
css
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline;} /* html5 display-role reset older browsers */ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display: block;} body {line-height: 1;} ol, ul {list-style: none;} blockquote, q {quotes: none;} blockquote:before, blockquote:after, q:before, q:after {content: ''; content: none;} table {border-collapse: collapse; border-spacing: 0;} body { font-size: 16px; text-decoration: none; } h1, h2, h3, h4, h5, h6, p, { font-family: "lato", helvetica, arial, sans-serif; } .clearfloat { clear: both; } #mainwrapper { margin: 0 auto; max-width: 1280px; vertical-align: middle; width: 100%; } .container { margin: 0 auto; max-width: 980px; vertical-align: middle; width: 100%; } header .container { display: block; float: right; } header #nav { float: right; } div.hr { border: 0.01em solid #676767; } #nav2 { float: right; font-size: 12px; font-weight: 400; margin: 0 auto; padding: 5px 0; text-transform: uppercase; } #nav2 a:link, #nav2 a:visited { color: #676767; } #nav2 a:hover { color: #4284b8; } #nav2 li { vertical-align: middle; float:left; } #nav2 li, #nav2 li { display: inline-block; text-decoration: none; } #nav2 li { padding: 5px 10px; } #nav2 li ul { display: none; position: absolute; } #nav2 li:hover ul { display: block; } #nav2 li ul li { clear: both; } #nav2 .nav2a { float: right; } #fullnav { text-align: center; } #fullnav #logosymbol, #fullnav #logotext { display: inline; margin: 0 auto; padding: 0 5px; } #mainnav { font-size: 12px; font-weight: 400; margin: 0 auto; padding: 5px 0; text-transform: uppercase; } #mainnav a:link, #mainnav a:visited { color: #676767; } #mainnav a:hover { color: #4284b8; } #mainnav li { vertical-align: middle; } #mainnav li, #mainnav li { display: inline-block; text-decoration: none; } #mainnav li { padding: 5px 25px; } #mainnav li ul { display: none; position: absolute; } #mainnav li:hover ul { display: block; } #mainnav li ul li { clear: both; } #footernav { float: right; font-size: 12px; font-weight: 400; margin: 0 auto; padding: 5px 0; text-transform: uppercase; } #footernav a:link, #footernav a:visited { color: #676767; } #footernav a:hover { color: #6e8878; } #footernav li { vertical-align: middle; float:left; } #footernav li, #footernav li { display: inline-block; text-decoration: none; } #footernav li { padding: 5px 10px; } #footernav li ul { display: none; position: absolute; } #footernav li:hover ul { display: block; } #nav3b { display: none; clear: both; } #nav3b a:hover { display: block; } #footernav .nav3a { float: right; } #breadcrumbs { float: right; font-size: 9px; font-weight: 400; margin: 0 auto; text-transform: uppercase; } #breadcrumbs .currentpg { color: #676767; font-weight:bold; } #breadcrumbs a:link, #breadcrumbs a:visited { color: #8b8b8b; } #breadcrumbs a:hover { color: #4284b8; } #breadcrumbs li { vertical-align: middle; float:left; } #breadcrumbs li { padding: 0 .25em 0 0; } #breadcrumbs li:after { content: " | "; display: inline-block; font-size: 100%; margin: 0 0 0 1.25em; } #breadcrumbs li:last-child:after { content: " "; } #breadcrumbs li, #breadcrumbs li { display: inline-block; text-decoration: none; } #breadcrumbs li { padding: 5px 10px; } #breadcrumbs li a:last-child { padding-right: 0; } #breadcrumbs .breadinfo { float: right; padding-bottom: 5px; } .brandlist { display: inline; overflow: auto; text-align: center; vertical-align: middle; width: 100%; } .brandimg { display: block; float: left; margin: 0 auto; max-width: 442px; padding-right: 8px; vertical-align: middle; width: 50%; } .brandcopy { display: block; float: left; font-size: 12px; font-weight: 400; margin: 0 auto; overflow: hidden; padding-left: 8px; position: relative; text-transform: uppercase; vertical-align: middle; width: 50%; } .brandcopy p { display: block; font-size: 16px; text-transform: none; line-height: 150%; } .brandcopy .currentpg { color: #676767; font-weight:bold; } .brandcopy a:link, .brandcopy a:visited { color: #4284b8; font-weight: bold; text-decoration: none; } .brandcopy a:hover { color: #959595; } .brandcopy .breadinfo { float: right; padding-bottom: 5px; } .brandcopy img { margin: 0 auto; margin-bottom: 16px; max-width: 442px; text-align: center; } .brandcopy p { margin-bottom: 16px; overflow: auto; text-align: left; }
edit: full css added.
ok, think you've tried add margin , padding .brandlist
div has display: inline
property. change display: inline-block
, margins , paddings should work. (check: http://tympanus.net/codrops/css_reference/display/).
Comments
Post a Comment