3 Replies - 736 Views - Last Post: 11 February 2013 - 04:24 AM

#1 qadeerhussain007  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 35
  • Joined: 05-July 12

converting a div tag into inline in css

Posted 10 February 2013 - 08:45 AM

Hello friends i have a problem in a css i want to convert a div tag into inline
<div id="menu1"> 
 <ul>
 <a href="#"> <li>  one</li> </a>
 <a href="#"> <li>  two</li> </a>
 <a href="#"> <li>  three</li> </a>
 <a href="#"> <li> four </li> </a>
 <a href="#"> <li> five</li> </a>
 <a href="#"> <li>six </li> </a>
 <a href="#"> <li> seven </li> </a>
 <a href="#"> <li> eight </li> </a>
 </ul>
 
 
 </div>


 <div id="menu2"> 
 
 <ul>
 <a href="#"> <li>  one</li> </a>
 <a href="#"> <li>  two</li> </a>
 <a href="#"> <li>  three</li> </a>
 <a href="#"> <li> four </li> </a>
 <a href="#"> <li> five</li> </a>
 <a href="#"> <li>six </li> </a>
 <a href="#"> <li> seven </li> </a>
 <a href="#"> <li> eight </li> </a>
 </ul>
 
 </div> 



now i want that a menu 1 display on,left side and menu 2 display on right side iam using display: inline but it is not working

This post has been edited by qadeerhussain007: 10 February 2013 - 08:46 AM


Is This A Good Question/Topic? 0
  • +

Replies To: converting a div tag into inline in css

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 2890
  • View blog
  • Posts: 9,597
  • Joined: 12-December 12

Re: converting a div tag into inline in css

Posted 10 February 2013 - 08:58 AM

Your HTML is mal-formed. The only elements that should appear as direct descendants (children) of UL tags are LIs. Your A links should occur within the LIs.

display:inline on its own will not work. You need to research css for page layout or css liquid layouts etc, which generally make use of floats.

AND WHY is this in the PHP forum? It has nothing to do with PHP.

This post has been edited by andrewsw: 10 February 2013 - 08:59 AM

Was This Post Helpful? 1
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5960
  • View blog
  • Posts: 23,235
  • Joined: 23-August 08

Re: converting a div tag into inline in css

Posted 10 February 2013 - 09:31 AM

Moved to HTML/CSS
Was This Post Helpful? 0
  • +
  • -

#4 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 408
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

Re: converting a div tag into inline in css

Posted 11 February 2013 - 04:24 AM

Well, how about using
display: inline-block; instead of just inline...
div
{
display: inline-block;
}


And yes, like andrewsw said...you need to place the <a> tags within your <li> tags like this...

<ul>
 <li><a href="#"> one </a></li> 
 <li><a href="#"> two </a></li>



regards,
Raghav

This post has been edited by raghav.naganathan: 11 February 2013 - 04:32 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1