Does anyone know of a good way to use CSS to position an image immediately to the right of a heading tag?
Right now I've got the image inside the <h1></h1>, and I'm not crazy about doing things that way.
Are you a Google Analytics enthusiast?
Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE!

www.CustomReportSharing.com
From the folks who brought you High Rankings!
More SEO Content
International SEM | Social Media | Search Friendly Design | SEO | Paid Search / PPC | Seminars | Forum Threads | Q&A | Copywriting | Keyword Research | Web Analytics / Conversions | Blogging | Dynamic Sites | Linking | SEO Services | Site Architecture | Search Engine Spam | Wrap-ups | Business Issues | HRA Questions | Online Courses
Css Image Positioning
Started by
qwerty
, Oct 27 2003 10:11 AM
6 replies to this topic
#1
Posted 27 October 2003 - 10:11 AM
#2
Posted 27 October 2003 - 10:53 AM
Place both the headtag and the image in different <div> tags and then apply appropriate positioning to each.
Hope this helps.
Hope this helps.
#3
Posted 27 October 2003 - 03:36 PM
put them in a sized <div> then use <img> tag before the <hn> tag and set float:right; for the <img>
div.whatever {
position:relative;
top:nnpx;
width:nnpx;
height:nnpx;
}
img.whatever {
position:relative;
float:right;
}
<div class="whatever">
<img class="whatever" src="imagepath" alt="">
<h1>Some text</h1>
</div>
Chris.
div.whatever {
position:relative;
top:nnpx;
width:nnpx;
height:nnpx;
}
img.whatever {
position:relative;
float:right;
}
<div class="whatever">
<img class="whatever" src="imagepath" alt="">
<h1>Some text</h1>
</div>
Chris.
#4
Posted 27 October 2003 - 04:05 PM
Doesn't that mean that if I want the image to appear a given distance from the last letter, I'll need to resize the div each time I create a header, based on the length of the text?
#5
Posted 27 October 2003 - 04:45 PM
<div id="tagline"> <h1 style="display:inline;">Your Heading Here</h1> <img src="/path/to/image" /> </div>
That should do it.
cheers,
Craig
#6
Posted 27 October 2003 - 04:53 PM
and if you want to place a set distance between the image and the text, wrap the img tag in a span and set padding. For example:
and in your external style sheet add:
cheers,
Craig
<div id="tagline"> <h1 style="display:inline;">Your Heading Here</h1> <span class="leftPadding"><img src="/path/to/image" /></span> </div>
and in your external style sheet add:
.leftPadding{padding-left:185px;}cheers,
Craig
#7
Posted 27 October 2003 - 05:08 PM
That looks like it'll work. Thanks.
I've still got a ways to go before I get to that step, though. I'm trying to redesign the page to get rid of something like three levels of nested tables. Once I've got all the layers positioning properly I can get started on formatting the content.
I've still got a ways to go before I get to that step, though. I'm trying to redesign the page to get rid of something like three levels of nested tables. Once I've got all the layers positioning properly I can get started on formatting the content.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users








