473,480 Members | 1,498 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Centering an img with text

TC
I'm trying to center the Yahoo Join Groups image with the text below
it. Using markup in the doc, I'd just use <center> tags. But I'm using
css. How can I do this?

<!-- Add link to join Yahoo Groups -->
<a href="http://groups.yahoo.com/group/floridahunters/join">
<img class="yahooGrp"
src="http://us.i1.yimg.com/us.yimg.com/i/yg/img/i/us/ui/join.gif"
alt="" />Join FloridaHunters</a>

Can be seen at:

http://www.unitedhunters.org/index.html

TIA!
Nov 6 '05 #1
10 1926
TC wrote on 06 nov 2005 in comp.infosystems.www.authoring.stylesheets:
I'm trying to center the Yahoo Join Groups image with the text below
it. Using markup in the doc, I'd just use <center> tags. But I'm using
css. How can I do this?

<!-- Add link to join Yahoo Groups -->
<a href="http://groups.yahoo.com/group/floridahunters/join">
<img class="yahooGrp"
src="http://us.i1.yimg.com/us.yimg.com/i/yg/img/i/us/ui/join.gif"
alt="" />Join FloridaHunters</a>

Can be seen at:

http://www.unitedhunters.org/index.html


<h3>Magazines</h3>
<ul>
<li><a href="http://www.floridawildlifemagazine.com/">Florida
Wildlife</a></li>
<li><a href="http://www.woodsnwater.net/">Woods &amp; Water</a>
</li>
</ul>

<!-- Add link to join Yahoo Groups -->

<div style='text-align:center;'>

<a href="http://groups.yahoo.com/group/floridahunters/join">
<img class="yahooGrp"
src="http://us.i1.yimg.com/us.yimg.com/i/yg/img/i/us/ui/join.gif"
alt="" />Join FloridaHunters</a>

</div>

</div>
<!-- End Navigation -->
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Nov 6 '05 #2
TC
Evertjan. wrote:
TC wrote on 06 nov 2005 in comp.infosystems.www.authoring.stylesheets:
I'm trying to center the Yahoo Join Groups image with the text below
it. Using markup in the doc, I'd just use <center> tags. But I'm
using css. How can I do this?

<!-- Add link to join Yahoo Groups -->
<a href="http://groups.yahoo.com/group/floridahunters/join">
<img class="yahooGrp"
src="http://us.i1.yimg.com/us.yimg.com/i/yg/img/i/us/ui/join.gif"
alt="" />Join FloridaHunters</a>

Can be seen at:

http://www.unitedhunters.org/index.html


<h3>Magazines</h3>
<ul>
<li><a
href="http://www.floridawildlifemagazine.com/">Florida
Wildlife</a></li> <li><a
href="http://www.woodsnwater.net/">Woods &amp; Water</a> </li>
</ul>

<!-- Add link to join Yahoo Groups -->

<div style='text-align:center;'>

<a href="http://groups.yahoo.com/group/floridahunters/join">
<img class="yahooGrp"
src="http://us.i1.yimg.com/us.yimg.com/i/yg/img/i/us/ui/join.gif"
alt="" />Join FloridaHunters</a>

</div>

</div>
<!-- End Navigation -->


Arggg! That was too easy. I was thinking it would be much harder.
Thanks!
Nov 6 '05 #3

"TC" <no*****@yahoo.com> writes:
I'm trying to center the Yahoo Join Groups image with the text below
it. Using markup in the doc, I'd just use <center> tags. But I'm using
css. How can I do this?


I only mention the method I use because I consider it a hack and I'd
be interested in hearing of a more elegant solution.

div.image-container { width: XXXpx; }
#image-name { width: XXXpx; height: XXXpx; }
div.image-container {float: left;}

<div class="image-container">
<img id="image-name" src="NNN.png" alt="[image identifier]" />
<div>
<span>Caption text</span>
</div>
</div>

--

Haines Brown
KB1GRM
Nov 6 '05 #4
TC wrote:
I'm trying to center the Yahoo Join Groups image with the text below
it. Using markup in the doc, I'd just use <center> tags. But I'm using
css. How can I do this?

..captioned-figure { text-align: center; }
..captioned-figure img { border: 0; }

<p class="captioned-figure">
<a href="http://groups.yahoo.com/group/floridahunters/join">
<img src="http://us.i1.yimg.com/us.yimg.com/i/yg/img/i/us/ui/join.gif"
alt="" />
<br />Join FloridaHunters</a>
</p>
This works for floating the image+caption as well. Just add float:left
or float:right to "captioned-figure".

It would save a little load time if you download the image and serve it
locally rather than link to it directly.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Nov 7 '05 #5
TC
Jim Moe wrote:
TC wrote:
I'm trying to center the Yahoo Join Groups image with the text below
it. Using markup in the doc, I'd just use <center> tags. But I'm
using css. How can I do this?

.captioned-figure { text-align: center; }
.captioned-figure img { border: 0; }

<p class="captioned-figure">
<a href="http://groups.yahoo.com/group/floridahunters/join">
<img src="http://us.i1.yimg.com/us.yimg.com/i/yg/img/i/us/ui/join.gif"
alt="" />
<br />Join FloridaHunters</a>
</p>
This works for floating the image+caption as well. Just add
float:left or float:right to "captioned-figure".

It would save a little load time if you download the image and serve
it locally rather than link to it directly.


Good idea! Done.
Nov 7 '05 #6
Jim Moe wrote on 07 nov 2005 in
comp.infosystems.www.authoring.stylesheets:

<img
src="http://us.i1.yimg.com/us.yimg.com/i/yg/img/i/us/ui/join.gif"
alt="" /> It would save a little load time if you download the image and
serve it
locally rather than link to it directly.


Why?

could be that http://us.i1.yimg.com is much faster than your own server.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Nov 7 '05 #7
Evertjan. wrote:
It would save a little load time if you download the image and
serve it locally rather than link to it directly.

Why?

could be that http://us.i1.yimg.com is much faster than your own server.

It may be. But then there is the DNS lookup, establishing another
connection, and that the image may move somewhere else, or disappear
altogether, spontaneously.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Nov 7 '05 #8
Jim Moe wrote on 07 nov 2005 in
comp.infosystems.www.authoring.stylesheets:
Evertjan. wrote:
It would save a little load time if you download the image and
serve it locally rather than link to it directly.

Why?

could be that http://us.i1.yimg.com is much faster than your own
server.

It may be. But then there is the DNS lookup, establishing another
connection, and that the image may move somewhere else, or disappear
altogether, spontaneously.


So it is, Jim, but that is not important as loading time.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Nov 7 '05 #9
Apart from the maintenance / reliability headache already mentioned it
will take more than 1.5k data plus additional and possibly large
latencies just to lookup the other server and establish the connection
to it.

Unless its a large image or the server is a slug I very much doubt a
visitor would ever get such a small image delivered quicker from
another site.

I say copy it locally (if u r allowed).

Nov 7 '05 #10
otto wrote on 07 nov 2005 in comp.infosystems.www.authoring.stylesheets:
Apart from the maintenance / reliability headache already mentioned it
will take more than 1.5k data plus additional and possibly large
latencies just to lookup the other server and establish the connection
to it.

Unless its a large image or the server is a slug I very much doubt a
visitor would ever get such a small image delivered quicker from
another site.


This is not email, but usenet, so please follow usenet Netiquette and quote
what you are replying on.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Nov 8 '05 #11

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

Similar topics

11
15031
by: Jeff Thies | last post by:
I have a series of blocks that are float left that I need centered on the page. <div class="center" align="center"> <div style="width: 100 px;float: left">thumbnail 1</div> <div style="width:...
3
7342
by: Jonah Bishop | last post by:
I have a puzzling problem with centering text, and I'm hoping that someone here can help me out. First of all, let me state that I am using XHTML 1.0 Strict and CSS for all layout purposes (no...
2
2224
by: Ryan W Sims | last post by:
I'm having trouble with centering in IE... http://www.ryanwsims.com/koh/ The image should center over the text. It does in Firebird, but not in IE for some reason. If you look at ...
3
4616
by: CMAR | last post by:
To center my <div>, I am currently using something like <div id="navcontainer" align="center"> This centers fine, but is deprecated code. I have seen these two solutions recommended. 1) ...
15
13475
by: red | last post by:
How do I center two side by side divs ? I've been writing css pages for a while but there's one thing tha still eludes me. I can center a div with margin auto. I can place two divs side by side...
3
6100
by: yawnmoth | last post by:
I'm trying to center list elements in a webpage I'm working on, and setting margin-left to auto for ol (or ul) seems to prevent the number (or bullet) from displaying in IE6 (strict mode) and...
3
4186
by: John Pote | last post by:
1. Horizontal centering a <divin browser window. The current trend seems to be to place page content in a fixed width area in the middle of the browser window. How is this achieved? If I use a...
5
4801
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up...
4
4058
by: SAL | last post by:
Hello, is there a way to menu control dynamically center itself horizontally on a page? I have placed a menu control in a panel control (no ajax) and would like it to center itself. Depending on...
1
2268
by: =?Utf-8?B?ZnJhbmt5?= | last post by:
Hello, I've created a table that has two rows that are span across three columns. The third row has three columns, each with an image. The last row is also span accross three columns. The span...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4483
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.