FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Can't get a CSS menu to sit right

 


PatTheGreat42
Page in question: http://www.patthegreat.com/
CSS file in question: http://www.patthegreat.com/textpattern/css.php?n=default

Alright, I got a problem that's been bugging me for a while. If you'll notice on the page in question, there's what's supposed to be a menu (Currently reads "Home," "Articles," and "About") on the left side. However, I can't get it to sit all the way to the left; it insists on sticking out a bit. I was hoping someone could tell me how to fix the problem. I'd like to avoid absolute placements on the bits of my page, but at this point I'm willing to try anything!

Thanks!
canassassin
try assigning it a negative margin:

margin-left: -20px

just an idea, il go look over the code in detail
canassassin
yes,

actualy assigning it like this:

Code:
margin-left: -45px;


it should be aligned almost perfect.
Hope this helps.
jmlworld
PatTheGreat42 wrote:
Alright, I got a problem that's been bugging me for a while. If you'll notice on the page in question, there's what's supposed to be a menu (Currently reads "Home," "Articles," and "About") on the left side. However, I can't get it to sit all the way to the left; it insists on sticking out a bit. I was hoping someone could tell me how to fix the problem. I'd like to avoid absolute placements on the bits of my page, but at this point I'm willing to try anything!
Thanks!


PatTheGreat,

As I have seen in your CSS file, you didn't declare a positioning/alignment for your menu. Your menu reads as:
Quote:
Code:

<ul id="menu">
<!-- The Menu List-->
</ul>


I couldn't find a #menu{margin: blahblah;} code in your stylesheet. Only you used #menu a. Try to put the following CSS before the the #menu a. It should work:

Code:

#menu{
  margin-left:0;
  }

Edit
The reason your menu is not going to sit the left and insists on sticking out a bit is that because the browser returns the default listing style...

Let me know if this works, please
PatTheGreat42
Sweet! Both solutions, the negative margin left and the zero margin left in the #menu tag worked! Y'all rock!
sonam
Some browser didn't recognise negative margings and IE sometimes calculate double.

Sonam
b4r4t
sonam wrote:
Some browser didn't recognise negative margings and IE sometimes calculate double.

Sonam


For double marhins in float just add display:inline for floated elements Smile
sonam
b4r4t wrote:

For double marhins in float just add display:inline for floated elements Smile


Thanks, this is very useful. Did I need to create display:inline for IE browser in extra css or I can put in regular css without wory about FF and other browser.

Sonam
b4r4t
sonam wrote:
b4r4t wrote:

For double marhins in float just add display:inline for floated elements Smile


Thanks, this is very useful. Did I need to create display:inline for IE browser in extra css or I can put in regular css without wory about FF and other browser.

Sonam


You can do it in one style because float changes display mode to BLOCK and nothing can override it Smile This element still will be BLOCK, even if You write inline - but IE will start to display proper margins/paddings Smile

For more info check double margin or double padding in google Smile
sonam
Quote:
You can do it in one style because float changes display mode to BLOCK and nothing can override it This element still will be BLOCK, even if You write inline - but IE will start to display proper margins/paddings.


Thanks, I understand what do you mean. In some situations was create different css for IE. Sad

Sonam
ccube921
IE isnt very efficient it messes up lots of positioning code
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.