Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to align these images and text in one line here is the code
css
CSS
#ul.nav {
  list-style: none; 
  border-top: 20px solid #FFF; 
 
}

ul.nav li {
  float: left;
  text-align:left;
  width: 23%;
   font-family:Cambria;
  font-size:large;

}
ul.nav li img{
  display:block;
}


html
HTML
h2>Select Cateogry</h2> 
    
    <ul class="nav">
  <li class="whoweare"><img src="images/cars.png"><a href="#">CARS</a></li>
  <li class="services"><img src="images/jobs.jpg"><a href="#">JOBS</a></li>
  <li class="contact"><img src="images/services.jpg"><a href="#">SERVICES</a></li>
</ul>



please check this image
http://i61.tinypic.com/szfwk2.png[^]
Posted
Comments
Karthik Holla 4-Jun-14 11:32am    
Align it with the help of table.
Diya Ayesa 4-Jun-14 11:35am    
how?
Karthik Holla 4-Jun-14 11:38am    
Check solution. Reply if it works

remove the # from:
#ul.nav 
 
Share this answer
 
Use table tag to align it.
XML
<table>
    <ul class="nav">
        <tr>
            <td>
                <li class="whoweare">
                    <img src="images/cars.png"><a href="#">CARS</a></li>
            </td>
            <td>
                <li class="services">
                    <img src="images/jobs.jpg"><a href="#">JOBS</a></li>
            </td>
            <td>
                <li class="contact">
                    <img src="images/services.jpg"><a href="#">SERVICES</a></li>
            </td>
        </tr>
    </ul>
</table>
 
Share this answer
 
Comments
Diya Ayesa 4-Jun-14 11:49am    
it works
Diya Ayesa 4-Jun-14 12:16pm    
@karthik holla this <ul class="nav"> should be inside the table tag or i write outside table tag

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900