html - Images are not floating up -
i trying float row of 4 images. however, not floating. attach code , screenshot of website locally hosted. have tried putting float in other parts of css such in #sidebar{float:left;}. not sure why not float. have tried .left{float:left} makes sidebar smaller. confused this.
/* ----- fonts css ----- */ body { font-family: 'comfortaa', cursive, sans-serif; margin: 0; padding: 0; } /* ----- end fonts css ----- */ .indexbody { width: 100%; background-image: url("city.jpg"); color: #fff; } #textlogo { text-align: center; font-size: 46px; } /*---- index page ----*/ .servicetitle { float: left; width: 49%; text-align: center; margin-bottom: 0; } .serviceimage { float: left; margin-left: 4.5%; margin-bottom: 9%; margin-top: 3%; width: 600px; } .serviceimage:hover { background-image: url("img_3134.jpg"); } .clearfix { clear: both; } footer { color: #fff; font-size: 24px; text-align: center; } /*---- photograohy portfolio index page ----*/ nav ul { width: 75%; } nav ul li { list-style-type: none; font-size: 34px; color: #fff; text-align: center; padding: 15px; border-bottom: 2px solid black; } nav ul li { text-decoration: none; color: black; } nav ul li a:hover { color: blue; } .col1 { float: left; width: 35%; } .photobody { margin: 0; background-color: #fff; } #sidebar { width: 20%; } .navigation { background-color: #fff; width: 100%; height: 100%; } #photoglogo { text-align: center; font-size: 46px; color: black; margin-top: 0; } .main1 { width: 70%; clear: both; } .row1 { float: left; width: 20%; padding: 3px; margin: 1%; border: 2px solid black; } /*test*/ .right { float: right; } <body class="photobody"> <div class="left"> <div id="sidebar"> <div class="navigation"> <h1 id="photoglogo">text logo</h1> <nav> <ul> <li><a href="#">home</a></li> <li><a href="#">about</a></li> <li><a href="#">portfolio</a></li> <li><a href="#">services</a></li> <li><a href="#">contact</a></li> </ul> </nav> </div> </div> </div> <div class="right"> <div class="main1"> <img class="row1" src="img_4085.jpg" alt="coastline" /> <img class="row1" src="img_4085.jpg" alt="coastline" /> <img class="row1" src="img_4085.jpg" alt="coastline" /> <img class="row1" src="img_4085.jpg" alt="coastline" /> </div> </div> </body>
if understand want, way :
.main1{ width: 35%; clear: both; } .row1{ display:block; left:0; float:left; width: 100%; padding: 3px; margin: 1%; border: 2px solid black; } 
Comments
Post a Comment