473,385 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Icon hanging below first line

I'm trying to style an icon "hanging" below the first line of a
heading and I've found interesting difference between Mozilla and
the other browsers I'm trying with - Safari 3.1.1, Opera 9.27 and
IE 6:

http://www.geocities.com/stanio/test/hanging-icon.html

I've used negative 'text-indent' and with Mozilla the first line of
text doesn't flow over the "hanging" icon, while with the other
browsers I see what I want to achieve. Which is correct in this
case - what I see with Mozilla or with the other browsers? Could I
achieve the same effect another way?

--
Stanimir
Jun 27 '08 #1
5 2367
On 2008-06-07, Stanimir Stamenkov <s7****@netscape.netwrote:
I'm trying to style an icon "hanging" below the first line of a
heading and I've found interesting difference between Mozilla and
the other browsers I'm trying with - Safari 3.1.1, Opera 9.27 and
IE 6:

http://www.geocities.com/stanio/test/hanging-icon.html

I've used negative 'text-indent' and with Mozilla the first line of
text doesn't flow over the "hanging" icon, while with the other
browsers I see what I want to achieve. Which is correct in this
case - what I see with Mozilla or with the other browsers? Could I
achieve the same effect another way?
It looks like a bug in Firefox. It seems to be having problems applying
text-indent when there's a float before the first bit of text.

Take the floated <imgout of the <h2and put it before it instead and
you should get the same effect in all the browsers. You'll need to
change "h2 .icon" just to .icon.

Check it's still valid if you do that-- you might need to put a div
around the img. And you also might want to repeat the <aaround the
<imgso it's still a link.

I say "still" valid, it's not valid at the moment, so you will need to
fix a few other things first. Test it at http://validator.w3.org.
Jun 27 '08 #2
Sat, 07 Jun 2008 11:35:57 -0500, /Ben C/:
On 2008-06-07, Stanimir Stamenkov <s7****@netscape.netwrote:
>http://www.geocities.com/stanio/test/hanging-icon.html

I've used negative 'text-indent' and with Mozilla the first line of
text doesn't flow over the "hanging" icon, while with the other
browsers I see what I want to achieve. Which is correct in this
case - what I see with Mozilla or with the other browsers? Could I
achieve the same effect another way?

Take the floated <imgout of the <h2and put it before it instead and
you should get the same effect in all the browsers. You'll need to
change "h2 .icon" just to .icon.
I see. The problem is I didn't want to take the icon out of the
heading and the link it constitutes, i.e. I don't want to have two
links where the icon one is generally empty (has no text content).
I say "still" valid, it's not valid at the moment, so you will need to
fix a few other things first. Test it at http://validator.w3.org.
The validation errors come from the Yahoo added garbage. If you
save it locally and clean the garbage manually - it is o.k. Sorry
for the inconvenience.

--
Stanimir
Jun 27 '08 #3
Sat, 07 Jun 2008 11:35:57 -0500, /Ben C/:
It looks like a bug in Firefox. It seems to be having problems applying
text-indent when there's a float before the first bit of text.
For whoever might be interested it appears as a known issue:

https://bugzilla.mozilla.org/show_bug.cgi?id=294306

--
Stanimir
Jun 27 '08 #4
Sun, 08 Jun 2008 14:20:23 +0300, /Stanimir Stamenkov/:
Sat, 07 Jun 2008 11:35:57 -0500, /Ben C/:
>On 2008-06-07, Stanimir Stamenkov <s7****@netscape.netwrote:
>>http://www.geocities.com/stanio/test/hanging-icon.html

I've used negative 'text-indent' and with Mozilla the first line of
text doesn't flow over the "hanging" icon, while with the other
browsers I see what I want to achieve. Which is correct in this case
- what I see with Mozilla or with the other browsers? Could I
achieve the same effect another way?

Take the floated <imgout of the <h2and put it before it instead
and you should get the same effect in all the browsers. You'll need to
change "h2 .icon" just to .icon.

I see. The problem is I didn't want to take the icon out of the heading
and the link it constitutes, i.e. I don't want to have two links where
the icon one is generally empty (has no text content).
My partial solution:

http://www.geocities.com/stanio/test...ng-icon-2.html

<h2><a href="#"><img alt="" src="icon1.png" class="icon">
<span>Lorem Ipsum Dolor Sit Amet Consectetuer Adipiscing
Elit</span></a></h2>

I enclose the link text in a SPAN which I style as block and give
text-indent to it. The drawback of it is the link active area is
extended to the whole block width and not just the text.

--
Stanimir
Jun 27 '08 #5
Sun, 08 Jun 2008 16:54:54 +0300, /Stanimir Stamenkov/:
My partial solution:

http://www.geocities.com/stanio/test...ng-icon-2.html

<h2><a href="#"><img alt="" src="icon1.png" class="icon">
<span>Lorem Ipsum Dolor Sit Amet Consectetuer Adipiscing
Elit</span></a></h2>

I enclose the link text in a SPAN which I style as block and give
text-indent to it. The drawback of it is the link active area is
extended to the whole block width and not just the text.
This seems like complete workaround in my case:

http://www.geocities.com/stanio/test...ng-icon-3.html

I've not styled the link and the SPAN in it as blocks, but given
negative margin to the SPAN. I had to explicitly style the
underline decoration and background-color on hover on the SPAN,
additionally.

--
Stanimir
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: omission9 | last post by:
Any advice on the following would be much appreciated. I have thrown everything I have at it and am completely stumped. I apologize for the length, I have tried to be as succint as possible. I...
6
by: Harlan Messinger | last post by:
A publication style guide indicates that for a table heading like the following, Table 3. Wheat and rye harvest in European countries in years that end in 3 or 7 or when a new prime minister...
25
by: Shannon Jacobs | last post by:
Maybe there is a simple trick here, and I'm not spotting it... Is there a guru of CSS hanging around here who can help out? The page in question has a multi-column table with a list of links in...
8
by: Ed Isenberg | last post by:
I notice that a lot of Web pages have an icon that is displayed preceding the URL in the place in the browser where the URL is displayed. When I bookmark or add this to Favorites the icon is also...
2
by: Jack | last post by:
I was learning Windows programming in C# using Charles Petzold book, but this book was written for the older version of .NET. The example of using icon from embedded resource fails to work when...
3
by: Tony Lugg | last post by:
I have an application with a document management form. When users add documents to the form, I call the API function SHGetFileInfo to get the associated large and small icons for the file. These...
5
by: David C. Allen | last post by:
I have a vb.net app that is controling excel 2000 thru the com interop interface. I have referenced the excel 9.0 library and have cut down the code in the problem subroutine to this: Dim...
4
by: randy1200 | last post by:
I have a Windows application that previously had the company logo "MyCompany.ico" added to the upper left-most corner. The company has since issued a new version of "MyCompany.ico" that looks...
1
by: ARC | last post by:
I have some functions that will allow a user to attach to a different back-end database. I added this functionality to the program Ribbon in a custom Access 2007 app. I have 2 ways to attach to a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.