Webmaster Key - Discussion Forums


Welcome, Guest. Please login or register.
Did you miss your activation email?
February 09, 2012, 03:24:32 AM

Login with username, password and session length
Welceome to Forums!

Important information for guests and new members:

In order to understand the full benefits of becoming an active member of this forum, please review the following information on guest and new member restrictions. These forum changes have been prompted by an overwhelming and unreasonable amount of bot postings and incoherent guest spam messages. We wish to prevent these events from happening in the future and make our community a more comfortable place for all of our members.

For guests:

Guests are not allowed to open new topics, polls, or posts attachments.
If you wish to open up new discussions on this forum, we encourage you to register.

For new members:

New members with less than five posts are not allowed to modify additional profile information such as avatars, contact information, biographies, and signatures. However, new members are encouraged to post their own topics or reply to topics initiated by other members. Become active on the forums and 5 posts should be an easy task!

We are a diverse community with members from all over the world. We encourage new ideas and interesting conversation. Do not be afraid to post webmaster/computer-related questions or problems, as our active members are always willing to help when they are able. Interested? Join us.

+ Webmaster Key Forums
|-+ Webmaster Corner
| |-+ Site Design and Web Authoring
| | |-+ CSS unordered list won't flow to right margin?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Stumble Upon! Digg It! del.icio.us! Add to Technorati! ReddIt!  Send this topic Print
Author Topic: CSS unordered list won't flow to right margin?  (Read 3024 times)
websj06
Jr. Member
*
Posts: 31


« on: October 16, 2006, 06:04:41 AM »


 Hello everyone:

  I am doing an exercise from a book.     LAST EDITED ON Oct-15-06 AT 09:54 PM (PST)


I attached external stylesheet, then add embedded style that will modify the unordered list. But the unorder list won't float to the right margin and background color won't change to color ivory as required.

Could someone take look at my code at tell me what's went wrong? Thanks in advanced!

code in external stylesheet
Code:
body {color: brown;}

h1, h2, h3, h4, h5, h6 {font-family: sans-serif; color: orange;}

address {color: orange; font-style: normal; font-variant: small-caps; text-align: center; clear: both;}


/* creating id for paragrapy contain photos */
p#head {text-align: right;}


#links {width: 150px; float: left; background-color: rgb(212, 142, 0); margin-right: 10px;}

/* format appearance of the link */
#links a {font-family: sans-serif; color: white; font-size: 9pt;}

#main {width: 70%; float: left;}

url to the file: http://www.cuj06.com/html/start1.html

Jeff
10-15-06
Report to moderator   Logged
Andy
Administrator
Veteran
*****
Posts: 5 752



« Reply #1 on: October 16, 2006, 09:48:38 AM »

Hi Jeff,

I think you are over-using the id selector such as in a paragraph where it's best to use the class selector. This causes a lot of headaches when you nest them like you are doing i.e. you have main enclosing box

I only use the id selector to define content blocks such as header, content and footer. Elsewhere it's best to use the class selector.

In your case, for the css to find your un-ordered link box, you need to list all the encapsulating ID tags in sequence in the style definition such as:
#main #box {float:right} or something like that.
Report to moderator   Logged

websj06
Jr. Member
*
Posts: 31


« Reply #2 on: October 16, 2006, 04:36:19 PM »

Hello Andy:

  Thanks for pointing out my problem. I modified the embeded stylesheet by using descendent selecotor

   #main #box {float: right; ect} in attached stylesheet. I issue got resolved Smiley

   I also learned when to use ID for proper case:)

Jeff
10-16-06
Report to moderator   Logged
Andy
Administrator
Veteran
*****
Posts: 5 752



« Reply #3 on: October 17, 2006, 12:02:52 PM »

No problem Jeff. I found css can quickly get out of control even though it's the way to go to separate styling from content.

btw. when I looked at your page it was deep in your site structure. Are you experimenting or do you have a live home page that you want to get visitors to? If so, you want this page in the root of the public html area not below a sub-directory called html.
Report to moderator   Logged

Pages: [1] Go Up Stumble Upon! Digg It! del.icio.us! Add to Technorati! ReddIt!  Send this topic Print 
+ Webmaster Key Forums
|-+ Webmaster Corner
| |-+ Site Design and Web Authoring
| | |-+ CSS unordered list won't flow to right margin?

Jump to:  
« previous next »


Our Partners
RelmaxTOP Ranking System Web Hosting RelmaxTOP Ranking System
Staff Sites
12Noon[12Noon Gallery] Andy[Urgentclick]
Tamuril[Tamuril's Digital Art Exhibit] Sensovision
Powered by MySQL Powered by PHP We are hosted by Relmax Inc. |Our Privacy Policy | Sitemap
Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC
Forum design by Tamuril © 2005.
Valid XHTML 1.0! Valid CSS!