PDA

View Full Version : Probably a VERY simple solution but I'm totally lost :)


BigToque
09-04-2006, 08:00 PM
Look at my website http://www.bigtoque.com/test

In the main page, I've got some announcments shown as Date - Headline, then who posted the announcement below.

What I want is to have the Date - Headline be underlined (the way it is now), but then have the line right below (who posted the announcement) to not be underlined (opposite of what it is right now).

How do I do this? If I add a 2nd [p] tag to my html, it adds all the line breaks that come with the [p] tag and I don't want that. I want the 2nd line of text to be right below the Date - Headline.

My code right now is:


echo '<p class="underline">' . date('F j, Y', strtotime($date)) . " - " . $headline . "<br/>";
echo "Posted by " . $author . "</p>";
echo '<p class="indent">' . $news . "</p>";
echo "<br/>";

Arbitrator
09-04-2006, 08:18 PM
Paragraphs have margins by default. You can kill the margins by doing one of the following, among other methods. If you still want the paragraphs to have margins, I find it works better to still set them to zero first then change the margins to the desired length so as to overcome browser inconsistencies.

* {margin: 0;} /* by default, all elements have no margins */
p {margin: 0;} /* by default, all paragraphs have no margins */

On another note, it's not semantic to use paragraph elements to mark-up contents that aren't paragraphs. The header elements (h1 … h6) would be more meaningful for the $headline and $author contents. Those six elements of course have their own share of defaults (font-size, font-weight, etc.) that will need to be tuned.

ronaldb66
09-05-2006, 08:38 AM
May I add to this that underlining text in the web realm is reserved by convention for links, and that underlining text that is not a link poses a serious usability issue?
You are therefore strongly recommended to not use underlining in this case, but apply other styling features (size, color, alignment, etc.) to set these apart.

GSimpson
09-05-2006, 09:57 AM
I'm no buddy with php unless its with myspl but, have you ever thought just having divs?

echo '<div class="underline">' . date('F j, Y', strtotime($date)) . " - " . $headline . "</div>";
echo "<div>Posted by " . $author . "</div>";
echo '<div class="indent">' . $news . "</div>";
echo "<br/>";

That way its a new line and you won't have a massive gap between them.
just something to think about.

try this - http://ambitous-spirit.freehostia.com/post.htm
Some history - I used to hate divs. Now me and divs we like brothers, only im bigger.