473,603 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ 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.co m/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 1936
TC wrote on 06 nov 2005 in comp.infosystem s.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.co m/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.floridawild lifemagazine.co m/">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.co m/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.infosystem s.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.co m/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.floridawild lifemagazine.co m/">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.co m/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="captione d-figure">
<a href="http://groups.yahoo.co m/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="captione d-figure">
<a href="http://groups.yahoo.co m/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.infosystem s.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.infosystem s.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

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: 100 px;float: left">thumbnail 2</div> <div style="width: 100 px;float: left">thumbnail 3</div> </div>
3
7352
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 tables). My website consists of a few, simple parts: a "container" DIV which is centered and 750 pixels wide, a "sidebar" DIV which can be found along the left side of the container, and a "content" DIV which fills up what's left of the right part of...
2
2233
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 http://www.ryanwsims.com/sd.php everything's fine (i.e. centered)
3
4628
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) body { text-align: center; min-width: 500px;
15
13489
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 with float. But I can't center two side by side divs. If I float them and give them auto margins, the auto margins are ignored. If I wrap the two floated divs in another div, the two divs have no
3
6109
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 Opera7 (it works fine in Firefox). Any ideas as to why and what I might do to fix it? I've set up a little demonstration of the problem here: http://www.frostjedi.com/terra/dev/test.html It's set up to render in quirks mode to demonstrate that it...
3
4196
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 top level <divthen I can place it with CSS attribute 'left:', but this is a fixed offset. Is it possible to have a <divcentered in the browser window? 2. Verticle centering in <div>
5
4813
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 doing this demo with tables. The main problems are the vertical centering of the info area, and of the text inside the squares.
4
4063
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 whose logged in, the menu, or course, displays different items, sometimes just two items, other times many more. If all menu items are displaying, centering is not a problem but when only two items are displayed, the menu appears on the left hand...
1
2274
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 rows are centering their data. however, the row with three columns, each with images (myimages1-3) are not centering with the rest of the table. Any idea why? Thanks in advance!
0
7928
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8060
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8273
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6735
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5878
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3951
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2430
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 we have to send another system
1
1514
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.