Jump to content

Recommended Posts

Posted

Hi,

 

Im wanting to center a photo in a phpwebsite block and have found that I cant by way of align="center"...it just gets ignored. So I added a <div align="center">, it works but Validator says "Dont!".

 

Im wondering if:

1. I can use div and ahef together

2. If so what order is legal <div><a href>... or <a href><div>...

 

Thanx.

 

Wayne ;)

Posted

<div> is a "division" or a section of the page. You would want to do this:

 

<div align="center"><a href=...> stuff </a> </div>

Posted

I think the validater would prefer that you create a section in your css file

to center the div

 

as in your css file

 

div.photo{

text-align: center;

}

 

then in your html

 

<div class="photo" >

<img src="photo.jpg" title="hi" />

</div>

 

 

Then you can add to the css

div.photo{

text-align: center;

border: medium solid black;

}

 

to add a border, or whatever.

 

 

 

 

Or you can also use in css

 

img.photo{

text-align: center;

border: medium solid black;

}

 

and the html

 

<img class="photo" src="photo.jpg" title="photo" />

Posted

It also depends on which standards you are trying to validate for. The most strict would disallow any placement or style things from the main page. Everything from centers to fonts to colors. The more casual standard would allow most of these.

 

Don has a great example here of how to do it the strict way. Thumbs Up

Posted

All, thanx for the input. Im off to see what I can do. Great feedback from TCH people...as usual.

 

This place rocks.

 

Wayne Rock Sign

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...