OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
Align without "align=" and "target"
This page's ID:
11033
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
[quote]OK, after searching a bit I found a couple posts on aligning something to the right using margins. But what if you just want to center some text? Do you just use "text-align: center?"[/quote] If you're just dealing with text inside a block level element (such as a paragraph or div), the text-align attribute will work fine. If you want to actually center the block level element itself, you set its width, and then use margin-left:auto; margin-right:auto; make sure that (a) the page has a valid doctype, and (b) the element *containing* the element you're centering spans the entire width of the page. [quote]What about the target attribute? Does that have to be done with JS now?[/quote] I think it's coming back in XHTML 2. In the meantime, yeah, use a JS onclick attribute, if you're using XHTML. [quote]Seems the point of web standards was to make things easier on designers. This doesn't seem much easier to me...[/quote] I know what you mean. Keep in mind that the majority of the difficulties come from poor browser implementations; the standards themselves are actually pretty good and getting better. The theory behind it is also very good - separation of content from style and all that. But there's no doubt that sometimes you just have to use a table or two. [edit: and using tables, I should add, doesn't make a web page non-standard. In fact, you could probably make a primarily table-based design and still have a standards-compliant page. The difficulty you're experiencing comes from making a full-CSS design, not just the usage of standards.] [This message has been edited by Slime (edited 08-25-2003).]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »