PDA

View Full Version : Help for a Newbe



Fizzy
01-02-2006, 10:32 PM
Hi,

I am just learning CSS and working on my first page. I thought I understood the concept of block and linline but apparently not.

I am simply trying to have text (one word) show up three times spaced equal across a single line

eg. Text__________Text___________Text

I used the following code and planed to add a margin or padding style but I can not even get the items to line up. Ugh! what am i missing?

<ul style="font:'Myriad Pro';color:red;display:inline;list-style-type:none;">
<li>before</li>
<li>before</li>
<li>before</li></ul>

mwinter
01-03-2006, 12:42 AM
I am simply trying to have text (one word) show up three times spaced equal across a single lineWhy? The best answer can depend such details. I can think of five possible solutions.


I used the following code and planed to add a margin or padding style but I can not even get the items to line up. Ugh! what am i missing?

<ul style="font:'Myriad Pro';color:red;display:inline;list-style-type:none;">
<li>before</li>
<li>before</li>
<li>before</li></ul>You've styled the list (ul) element to be in-line, but the list items still have a list-item display property value (block-level with list item semantics).


It's better to use a style sheet than in-line style attributes.
A generic font family should always accompany specific choices.
A background colour (even just transparent) should always be paired with a foreground colour, and visa versa. The only exception is where a declaration will be applied from another rule.
Mike

Fizzy
01-04-2006, 02:17 AM
Thanks for the help.

It looks like I found a solution (by accident I am afraid) that seems to work.

I used the following

<div id="list">
<p>test</p>
<p>test</p>
<p>test</p>

</div>

and in the Header...though I plan to create a style sheet as you suggested...I placed

div#list p{font:'Myriad Pro','Times New Roman';color:blue;display:inline;list-style-type:none;padding:150px;}

This is probably an odd way to get what I wanted but since my total expierence with CSS is reading a quick start guide, I'll take what I can get!