![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2006
Posts: 7
Rep Power: 0
![]() |
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#> 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? |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
|
|
#3 |
|
Expert Programmer
|
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" /> h1 { display: none; }
img { ... } |
|
|
|
|
|
#4 |
|
Unverified User
Join Date: Aug 2005
Location: none
Posts: 146
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#5 | |
|
Newbie
Join Date: Feb 2006
Posts: 7
Rep Power: 0
![]() |
Quote:
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. |
|
|
|
|
|
|
#6 | |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
Quote:
Look at the forum skin: the header is an image as well. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|