Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 19th, 2006, 6:10 PM   #1
asp1
Newbie
 
Join Date: Feb 2006
Posts: 7
Rep Power: 0 asp1 is on a distinguished road
Titles - HTML image or CSS bg?

I am struggling to decide which is better to use for title images. At the moment i tend to use something like
<h# class="title"><span>Title</span></h#>
With the text removed and h2 displayed as an image with CSS.

However, this means that the titles become invisible to anyone with images turned off, or if for any reason the image can't be found.

Why do so many people recommend using CSS for this as opposed to using an img alt tag?
asp1 is offline   Reply With Quote
Old Feb 19th, 2006, 6:39 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
You want to read recommendations, but you never want to turn your own rational brain off. A huge amount of internet content is acolytes echoing uncosidered opinions of those who have set themselves up as gurus and high-priests, and other bullshit.

I don't know why you want an image as a title (I can conceive of a few reasons, not many), but if you do, what's wrong with putting it in a image tag and having alt content for accessibility? After all, you can put the image tag inside another entity if you want to, and style away on the parent, if that's what flips your baton.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Feb 19th, 2006, 10:53 PM   #3
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 855
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
You might try something similar to the following.

On your web page, separate the <h1> and <img> tags:

<h1>My Website</h1>
<img src="header.jpg" width="300" height="100" alt="My Website" />
In your stylesheet, add:

h1 { display: none; }
img { ... }
The CSS property display:none is compatible with all modern browsers, so if your stylesheet does not load, humans will be able to read your page's title. And CSS or no, your page will be much more appealing to search engines.
titaniumdecoy is offline   Reply With Quote
Old Feb 19th, 2006, 11:02 PM   #4
a thing
Unverified User
 
a thing's Avatar
 
Join Date: Aug 2005
Location: none
Posts: 146
Rep Power: 0 a thing is on a distinguished road
I don't get why you'd use an image for a title. Text works fine.
__________________
Warning: My posts may change (dramatically) within the first 15 minutes they're posted.
Got 'Nux?—GNU/Linux and other free software support.
It's GNU/Linux, not just Linux.
a thing is offline   Reply With Quote
Old Feb 20th, 2006, 4:15 PM   #5
asp1
Newbie
 
Join Date: Feb 2006
Posts: 7
Rep Power: 0 asp1 is on a distinguished road
Quote:
Originally Posted by DaWei
You want to read recommendations, but you never want to turn your own rational brain off. A huge amount of internet content is acolytes echoing uncosidered opinions of those who have set themselves up as gurus and high-priests, and other bullshit.

I don't know why you want an image as a title (I can conceive of a few reasons, not many), but if you do, what's wrong with putting it in a image tag and having alt content for accessibility? After all, you can put the image tag inside another entity if you want to, and style away on the parent, if that's what flips your baton.
I partially agree with your first statement which is why the question arose.
The reason for using images for titles is purely for design, the argument for using css to display the title image is for SEO.
Neither way will achieve total accessiblility, the desired graphical appearance and high search engine ranking, so i am really looking for opinions as to which method is the best compomise or whether there is any workaround.

titaniumdecoy - Thank you for your suggestion, it looks like this may be the best possibility.
asp1 is offline   Reply With Quote
Old Feb 20th, 2006, 4:28 PM   #6
Polyphemus_
Expert Programmer
 
Polyphemus_'s Avatar
 
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4 Polyphemus_ is on a distinguished road
Quote:
Originally Posted by a thing
I don't get why you'd use an image for a title. Text works fine.
Not in all cases. There can be a unique and/or commercial font be used, which the user doesn't have, or there may be some additional make-up needed to create a more funkier design.
Look at the forum skin: the header is an image as well.
Polyphemus_ is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:48 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC