Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Basic H1 image replacement
Old 04-27-2008, 08:40 AM Basic H1 image replacement
dave9713's Avatar
Ultra Talker

Posts: 264
Name: David
Location: London
Trades: 2
Hi All,

What would be the easiest way to place my h1 tags beneath an image? Everything I seem to try just moves the page layout around ...

URL www.portfolio-properties.net

Thanks,

Dave
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

dave9713 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-27-2008, 09:00 AM Re: Basic H1 image replacement
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
A relative positioned container, position absolute and z-index of 1 for the heading so it is out of the document flow and below other elements then use position relative (or absolute) and z-index 10 for the image.

That way the container is part of the layout, while the heading and the image are isolated.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-27-2008, 12:07 PM Re: Basic H1 image replacement
dave9713's Avatar
Ultra Talker

Posts: 264
Name: David
Location: London
Trades: 2
Thanks Chris works a treat

Dave
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

dave9713 is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 09:57 AM Re: Basic H1 image replacement
Plugin-Developer's Avatar
Weightlifting CS Student

Posts: 504
Name: Nick Ohrn
Trades: 0
I would recommend another technique. First, set the image as the background image on your h1 tag, and keep the h1 tag where it is. Set the property text-indent on the h1 tag to some ridiculously negative value like -1000000px. This will hide the h1 text while still keeping the semantic meaning of the element. Be sure to set an explicit height and width on the element that is the same size as your image.
__________________

Please login or register to view this content. Registration is FREE
- Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
Plugin-Developer is offline
Reply With Quote
View Public Profile Visit Plugin-Developer's homepage!
 
Old 05-04-2008, 03:55 PM Re: Basic H1 image replacement
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
Why are you complicating it?

HTML Code:
<h1 style="height: XX; width: XX; background: url(image.jpg) top left no-repeat"><span style="visibility: hidden;">Heading 1 Text</span></h1>
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 05-04-2008, 04:58 PM Re: Basic H1 image replacement
Plugin-Developer's Avatar
Weightlifting CS Student

Posts: 504
Name: Nick Ohrn
Trades: 0
Mooofasa, I don't like that text because I don't think screen readers will pick up on the text if its visibility is set to hidden. I'm not sure though.
__________________

Please login or register to view this content. Registration is FREE
- Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
Plugin-Developer is offline
Reply With Quote
View Public Profile Visit Plugin-Developer's homepage!
 
Old 06-09-2008, 09:37 AM Re: Basic H1 image replacement
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
Then use display: none.
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 06-10-2008, 02:43 PM Re: Basic H1 image replacement
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
Most screen readers obey display:none;
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 06-10-2008, 08:49 PM Re: Basic H1 image replacement
Convert2Steve's Avatar
Experienced Talker

Posts: 35
Name: Steve Howe
Location: Salt Lake City
Trades: 0
I prefer this method where you move the text off the screen (text-indent: -9999px; or any arbitrary large negative figure) to the image replacement technique.

Personally this is how I do it:

h1, p.welcome, ul#nav li a {
display: block;
overflow: hidden;
font-size: 0.0; line-height: 0.0;
text-decoration: none; text-indent: -9999px;
background: transparent no-repeat 0 0;
}
h1 {
height: 20px; width: 500px;
background-image: url(header.img);
}
p.welcome {
height: 150px; width: 350px;
background-image: url(welcome.img);
}

This code easily allows for more elements to be replaced. Simply add the selector to the main replacement code, then create a separate declaration with the height, width and path to the appropriate image.

The display: block allows for the image replacement to be used on inline elements (such as anchors) with no extra code. The 0.0 on font-size and line-height are for bugs in the validator (!). And the overflow: hidden; trims the unsightly long 'focus halo' introduced in Firefox 1.5, so that is only the width of the content.
__________________

Please login or register to view this content. Registration is FREE
|
"We beat the street!"
phone:
(801) 413-3037 | aim: Convert2Steve | skype: Convert2Steve
Convert2Steve is offline
Reply With Quote
View Public Profile Visit Convert2Steve's homepage!
 
Reply     « Reply to Basic H1 image replacement
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.62109 seconds with 12 queries