Jump to content

Recommended Posts

Hello to everyone Smile

How do i display a dynamic navigation menu horizontally?

 

display:block;

float:left;

works for static menu but how to do it in dynamic menu.

I have a custom CMS which uses a php variable $display to show the menu links.

echo $menuDisplay

 

CSS

.menu a{ display:block;

float:left;}

 

but i guess this doesn't work so guys please help me out

Link to comment
https://forums.phpfreaks.com/topic/180958-css-for-dynamic-navigation-menu/
Share on other sites

display: inline; float: left;

 

displaying as inline is pointless if you're floating left. You'd do one of the other. Floating left and having display as block gives you more flexibility over the sizing of the element, whereas displaying inline will, well, display inline, so floating left is pointless.

we arent here for me. please keep you eye on the ball. if you want to debate post in misc. thanks.

 

The original reply wasn't aimed at you. It was telling the OP that you'd given bad advice.

 

Though this one is aimed at you, and for hijacking the thread I apologise.

we arent here for me. please keep you eye on the ball. if you want to debate post in misc. thanks.

 

The original reply wasn't aimed at you. It was telling the OP that you'd given bad advice.

 

Though this one is aimed at you, and for hijacking the thread I apologise.

i provided a link to another site that uses the same. im sure they can decide for themselves if it was bad info. and telling them i am giving bad info without a link as i provided to back your statement is a bad call. and yes, you did hijack the thread.

i provided a link to another site that uses the same. im sure they can decide for themselves if it was bad info. and telling them i am giving bad info without a link as i provided to back your statement is a bad call. and yes, you did hijack the thread.

 

The example provided via your link does not use display: inline; and float: left on one element.

 

Also, I try not to provide extrenal links when not necessary. I'm not here to teach people how to use google.

For IE Mac, we use display:inline-block;float:left; and we clear the columns using the footer.

    Yes, I had to break my promise a bit: just to support IE Mac I do use float here.

 

Now we need extra declarations:

 

    * vertical-align to make the content of the LIs appear near the header rather than the footer (by default, content appears bottom-aligned).

    * width to make the LIs sit next to each other rather than take the whole width of their parent container (note that the widths add up: 12em + 29em + 14em = 55em).

 

  #s1,#s2,#s3,{display:inline;zoom:1;vertical-align:top;}

  #s1 {width:12em;}

  #s2 {width:29em;}

  #s3 {width:14em;}

  /*\*//*/

  #s1,#s2,#s3 {display:inline-block;float:left;}

  #ft {clear:left;}

  /**/

i can see why

Just because you read something in a tutrial doesn't mean it's gospel.

 

If you read on you can see that is a hack to correct different browsers. I wouldn't advise someone to use a hack as standard, but add it if necessary. Wouldn't you agree?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.