![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'd like to align a <div> within the center of the visual canvas. The text within the div should be left-aligned. How can I possibly achieve this? So far I can only align text blocks centrally by using <table align="center" |
#3
| |||
| |||
|
| Axel Dahmen wrote: I'd like to align a <div> within the center of the visual canvas. The text within the div should be left-aligned. How can I possibly achieve this? So far I can only align text blocks centrally by using <table align="center" Set the width to something smaller than 100% and the margin to auto e.g. div.someClass { width: 100%; margin-left: auto; margin-right: auto; } div class="someClass">...</div snip / |
#4
| |||
| |||
|
|
and for a fixed width div use |
#5
| |||
| |||
|
|
and for a fixed width div use div.someClass{ width: 500px; position: relative; left: 50%; margin-left: -250px; /* half the width of the div */ } |
#6
| |||
| |||
|
| Axel Dahmen wrote: I'd like to align a <div> within the center of the visual canvas. The text within the div should be left-aligned. How can I possibly achieve this? So far I can only align text blocks centrally by using <table align="center" Set the width to something smaller than 100% and the margin to auto e.g. div.someClass { width: 100%; |
#7
| |||
| |||
|
|
On Sun, 21 Nov 2004 15:39:11 -0000, Phil Thompson wrote: and for a fixed width div use If I understand your CSS correctly, it will only work for a page that is 500px wide. Please drag yourself into the third millenium! |
|
Given the effort that people who contribute to this group put into encouraging fluid layout and having everything exactly as big as the *user* wants, it is disappointing to see people encouraging fixed widths that would lock the size of the page. |
|
-- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.LensEscapes.com/ Images that escape the mundane |
#8
| |||
| |||
|
|
Oh my god, sorry. I didn't realise I'd just brought about the apocalypse. Fluid is a great idea and yes it works sometimes but there are times, when big breath> shock horror, a fixed width layout works best. |
#9
| |||
| |||
|
|
Given the effort that people who contribute to this group put into encouraging fluid layout and having everything exactly as big as the *user* wants, it is disappointing to see people encouraging fixed widths that would lock the size of the page. Oh my god, sorry. I didn't realise I'd just brought about the apocalypse. Fluid is a great idea and yes it works sometimes but there are times, when big breath> shock horror, a fixed width layout works best. Read other peoples opinions here: http://www.designbyfire.com/000032.html p.s. Sorry I spoke. |
#10
| ||||||||||
| ||||||||||
|
|
"Andrew Thompson" <SeeMySites (AT) www (DOT) invalid> wrote in message news:k7d9w9j9bxnh.19y0pxo2cm4am$.dlg (AT) 40tude (DOT) net... On Sun, 21 Nov 2004 15:39:11 -0000, Phil Thompson wrote: and for a fixed width div use If I understand your CSS correctly, it will only work for a page that is 500px wide. Please drag yourself into the third millenium! a page that is at least 500px wide. I know that isn't wholly accessible but it is pretty damn close. |
|
Oh my god, sorry. I didn't realise I'd just brought about the apocalypse. Fluid is a great idea and yes it works sometimes but there are times, when big breath> shock horror, a fixed width layout works best. |
|
Read other peoples opinions here: http://www.designbyfire.com/000032.html |
|
Pros Guarantees line length readability |
|
Guarantees ability to place images into the layout in relation to other design elements and type size |
|
Allows for predictable printed results from screen to paper |
|
Allows for a predictable presentation as intended by the designer |
|
Cons Can produce unreadable or hard to scan line lengths |
|
Can allow images to become out of proportion to resized type settings or other design elements |
|
Can have serious issues when printed, even clipping off some content |
![]() |
| Thread Tools | |
| Display Modes | |
| |