Jump to content

Recommended Posts

Posted

><div id=NAVIGATION1 style=" width:129; position:absolute;top:302px;left:135px;"> 
fajsdlfsfdsdfasdfasfddasfffffffffffffffff
</div>

 

Okay I have a navigation bar that is exactly 129 px but the width element refuses to work!! please advise. :)

Posted

This could be because of your content in the div "fajsdlfsfdsdfasdfasfddasfffffffffffffffff". As this is just theoretically 1 long word it will stretch the div, rather than splitting it onto 2 lines, if you break up that "word" with spaces it should obey the width you have told it to, automatically putting a new "word" onto the next line when required.

 

There may be a way to make it split up your "long word" but I don't know how unfortunatly. However, unless you are going to have your site in welsh I doubt it will matter! :)

Posted (edited)

Also, I suggest you add quotes to the value of the id attribute, in order to make the code standards compliant :)

Edited by TCH-Raul
Posted

lol, no problem! anytime!

 

I only started learning CSS a couple of days ago, and I had that exact problem! Simple solution, but still took me a while to figure it out!

 

James

Posted

In addition, you will need to specify the width in pixels, as in

><div id="NAVIGATION1" style=" width:129px; position:absolute;top:302px;left:135px;">

 

instead of

><div id=NAVIGATION1 style=" width:129; position:absolute;top:302px;left:135px;">

 

without the designation of "px" for pixels, the browser has to make a guess as to whether you are referring to pixels, ems, etc.

Posted

Humm... I had that in my post (about adding the px) but it's not there, now... :)

 

Maybe I accidentally deleted it when I edited the post :)

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...