?
Solved

Dimension of a GIF

Posted on 1999-12-03
8
Medium Priority
?
299 Views
Last Modified: 2010-04-09
I use a GIF to underline a title...

How can I change automatically the size of the GIF to match the length of the title ?

For example when the user select SMALLER
SMALLEST LARGER LARGEST on his browser.
0
Comment
Question by:PhL
8 Comments
 
LVL 2

Expert Comment

by:cookmyster
ID: 2253548
<img src="name.gif" width="50" height="50">

just replace the numbers with the length and/or width of the title.


Rich
0
 
LVL 2

Expert Comment

by:mblase
ID: 2253767
I don't think there's any way to detect what fonts the client browser has selected as their default. Why not use <U>...</U> instead?

Or, use a hyperlink trick:

<A HREF="#"><FONT COLOR="black">....</FONT></A>
0
 

Author Comment

by:PhL
ID: 2253851
Underline is quite poor...

How can compute the lenght of the tiltle ?

Any script ?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 2

Expert Comment

by:mblase
ID: 2253886
No, you can't compute the length of a string of text, because you can't be certain of what font is being used by the client browser. You can come close on *most* browsers, but it will never be reliable.
0
 
LVL 85

Expert Comment

by:ozo
ID: 2253988
Could you use a <table>?
0
 
LVL 2

Expert Comment

by:mblase
ID: 2254032
Hmm, that's a good idea, ozo -- although you'd have to use a colored table cell and a single-pixel gif.

<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>
  <TR><TD NOWRAP>
This is my title
  </TD></TR>
  <TR><TD BGCOLOR="black" HEIGHT=1><IMG
    SRC="pixel.gif" WIDTH=1 HEIGHT=1 ALT=""></TD></TR>
</TABLE>
0
 
LVL 2

Accepted Solution

by:
egbservices earned 200 total points
ID: 2254310
If the size is so crucial why don't you create an image for the title too. This will retain the size and the font and your gif below it will always match the title.
0
 
LVL 1

Expert Comment

by:SiteSee
ID: 2254692
I have to agree with the last comment completely...you can make the image look like plain text if you really want to..and just keep it under 5kb and outside of a "loaded" table if you want it to appear quickly...

Steve
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question