Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tidying up text in a table - can't crack it

Status
Not open for further replies.

Sadruddin

Technical User
Joined
Nov 16, 2001
Messages
89
Location
GB
I'm looking for help with a difficulty I've had before and given up on, but can't really get round this time.

On my latest work-in-progress, at


the problem is in the blue text, bottom left. I'm using CSS and the text won't display close to itself, if you know what I mean. In effect I'd like the line gap to be close together but nothing I do seems to help. The CSS file is at
Any of you supremos (supremi) out there able to cast some light on this?

S
 
For starters

Code:
<span class="smoothguide9blue">designed, updated and<br> 
maintained by[COLOR=red]</span>[/color]<a href="[URL unfurl="true"]www.sheffieldmind.org.uk"[/URL] class="effect2">Sheffield Mind</a></span>

You have not opened a span element for the link. Perhaps take out the bit marked in red.
I've not studied the CSS, but I would start there.

- Web design and ranting
- Day of Defeat gaming community
"I'm making time
 
the text won't display close to itself, if you know what I mean.
Not entirely, but I'll try to figure it out.

You're looking to reduce the leading in typographic terms - the vertical spacing between lines. You've actually found the right CSS property for this - [tt]line-height[/tt]:
Code:
.smoothguide9blue {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 9px;
	color: #0033CC;
	[b]line-height: 7px;[/b]
}
The problem is (I think) you're applying this style to an inline element - <span> - which will ignore the line-height property. I suggest you lose the <span>s and either use a <div> instead, or apply the class to the <td> directly:
Code:
<td class="smoothguide9blue">
designed, updated and<br>maintained by <a href="[URL unfurl="true"]www.sheffieldmind.org.uk"[/URL] class="effect2">Sheffield Mind</a>
</td>

Here's two further tips. One, don't waste bandwidth declaring font families for every CSS class. Just declare it for the <body> and all other elements will inherit it:
Code:
body { font-family: Arial, Helvetica, sans-serif; }
If there are elements on your page that you don't want to display in that font, declare a [tt]font-family[/tt] for those specific elements (or classes).

Secondly, give your classes meaningful names. When you come to maintain this site in 12 months' time, you'll have quite forgotten what "smoothguide9blue" means and where it's used. Once you've figured that out, you may decide that that text looks better 10 pixels high in orange - making the class name even more cryptic. So call that class, say, "pagecredit" instead - it's the styling applied to the credits on each page. You'll know what it means and you're not tied to any specific visual presentation by the name.

You could also get rid of a lot of those nested tables...

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Chris, do you actually do anything else all day?

Once again, a seminal answer from the Man.

S
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top