473,326 Members | 2,133 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,326 software developers and data experts.

<center> equivalent in 4.01 strict...

Hi...

What's an equivalent of doing:

<center>hello!</center>

in 4.01 strict? I'm using stylesheets and am telling the various selectors I
want to be centred to "text-align : center;" but they only align textual
objects, not image objects:
div.thumbnail_cell {
display : block;
position : relative;
width : 100px;
color : white;
border-bottom : 1px solid silver;
}

div.center {
text-align : center;
}
<div class="thumbnail_cell">
<div class="center">
<br>
<img id="imgThumb0" class="thumbnail" src="images/blah.jpg"><br
class="small">
<input class="small" type="button" value="&lt;"
onClick="thumbOrder(0, this.value)">
<input class="small" type="button" value="&gt;"
onClick="thumbOrder(0, this.value)">
<input class="small" type="button" value="delete">
<br><br>
</div>
</div>

This centers the buttons, but not the images. How can I center the images
using CSS?
P.
Jul 20 '05 #1
2 4685
Aha! I have cracked it!

margin-left : auto;
margin-right : auto;

"The Plankmeister" <pl******************@hotmail.com> wrote in message
news:3f***********************@dread14.news.tele.d k...
Hi...

What's an equivalent of doing:

<center>hello!</center>

in 4.01 strict? I'm using stylesheets and am telling the various selectors I want to be centred to "text-align : center;" but they only align textual
objects, not image objects:
div.thumbnail_cell {
display : block;
position : relative;
width : 100px;
color : white;
border-bottom : 1px solid silver;
}

div.center {
text-align : center;
}
<div class="thumbnail_cell">
<div class="center">
<br>
<img id="imgThumb0" class="thumbnail" src="images/blah.jpg"><br
class="small">
<input class="small" type="button" value="&lt;"
onClick="thumbOrder(0, this.value)">
<input class="small" type="button" value="&gt;"
onClick="thumbOrder(0, this.value)">
<input class="small" type="button" value="delete">
<br><br>
</div>
</div>

This centers the buttons, but not the images. How can I center the images
using CSS?
P.

Jul 20 '05 #2
The Plankmeister wrote:
Aha! I have cracked it!

margin-left : auto;
margin-right : auto;


that's the bunny...think in terms of block level elements being
boxes...and place them using margin, then place the contents using padding

it takes a while to get used to...but it's actually far easier than tables

--
eric
www.ericjarvis.co.uk
"Hey Lord don't ask me questions
There ain't no answer in me"
Jul 20 '05 #3

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

Similar topics

34
by: Mark Moore | last post by:
It looks like there's a pretty serious CSS bug in IE6 (v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and renders as I would expect in Opera, FrontPage, and Netscape. For some...
11
by: Ben Amada | last post by:
Hello, When centering a block of HTML, in the past, I've always used: <div align="center"> ... </div> However, in VS 2005, I get the following warning: "Validation (XHTML 1.0...
3
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
by: Nathan Sokalski | last post by:
As most of us probably know, the <centertag is deprecated. Because many elements and controls have an align attribute, centering them is easy enough. However, certain elements/controls do not (such...
1
by: Steve Richter | last post by:
I am using <div align=centerto center a horizontal menu on the page. Problem is the center align of the div is rippling down to the menu items and causing the text of the dynamic popup sub menu...
1
by: jobs | last post by:
I have a simple login page with roughly a 300px x 300px image behind the asp.net login control. I need the login control to land in the middle of the image. I want both the image and the login...
4
by: DiamondEagle | last post by:
Is there a way to center the following div without using the <center> tags? <body bgcolor="#FFFFFF"> <center> <div id="Test" style="background-color:#000000; color:#ffffff; width: 80%;...
13
by: Stevo | last post by:
I've found that for IE6+, if you add the property text-align:center to a DIV, then *anything* inside it gets centered. That can be a table, an object/embed, another DIV, an image, or some text. ...
5
Plater
by: Plater | last post by:
To accomplish what I am looking for (the image centered in it's parent top 'centered') I have done this: <div id="backing"> <div id="lbImgBacker"> <center> <img id="Image1"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.