PDA

View Full Version : Mad ramble...



masterpeace
11-16-2003, 04:23 AM
OK, so I have decided to be a good little girl and start using CSS & validate my pages as HTML 4 and the first site went beautifully...

So I delve into site number two and I am working merrily on the design concept... It is simple layout. A centred block with a header and then another narrower centred block of content below...

Did I say simple??? Start trying to get anything to align in the centre of anything else using CSS and I have a nightmare with making it work at all in older browsers...

Of course to make it all much more "fun" the client is using an old version of Netscape which doesn't seem like the CSS at all, and I sound like a right idiot trying to explain that it is just his browser...

I am fairly sure I would be able to find a way to get it to work if I keep banging my head against it, but surely the idea of CSS is to make it simpler and not more difficult! Considering the client choses to work on a backward browser anyway I am seriously considering reverting to tables for the block positioning and just using CSS for the text styles...

Is there a simple way of aligning things centrally using CSS (both horizontally of vertically!) because I can't seem to find it! And being in the country I can't just nip out to the bookstore and find a reliable reference (two hours drive from nearest bookstore with computer section).

There are great references online, but I have to say I find references & training manuals are much easier to read on old fashioned paper for me...

Where are my "pink pills"

carbonize
11-16-2003, 05:13 AM
hmmmmmmm

text-align: center; ?

Netscape 4 has a hard time rendering HTML as it should be let alone CSS. Maybe you should point out to the client that less than 1% of internet users use NS4.

After my recent poll in here and various conversations I have decided no to support NS4. I will make sure it is legible and navigable on NS4 but I am no longer concerned about making it look the same on NS4. A good example of this was a recent clean up I did for a client in preperation for a shopping cart script, www.stationeryfirst.co.uk (http://www.stationeryfirst.co.uk), which just uses div's and CSS (with a few paragraphs). It's still looks good in NS4 but some of the backgrounds get messed up. I even managed to view the site on my mobile phones wap browser (enlightening experience).

OK for your second site (hope I have the right idea)


<div align="center" style="width: 770px;">
<div align="center">blah.jpg</div>
<div style="text-align: center; padding-right: 50px; padding-left: 50px;">Put body text etc in here</div>
</div>

I know you could of done padding: 0 50px 0 50px; but I can never remember which is which.

masterpeace
11-16-2003, 05:33 AM
Thanks carbonize.

I have been using the "text-align;center" in my style sheets to little avail. It is works in one it fails in another. Sometimes it centres the block and other times is centers the text inside the block!

I am trying to avoid the align="center" method because while it is the simplest & most reliable method it is also depreciated and there doesn't seem to be a replacement for it in CSS apart from the text-align which doesn't work in the same manner...

Am I missing something obvious here? I kind of feel like there should be a simple way for doing this and its just me...

carbonize
11-16-2003, 05:52 AM
You said you were coding in HTML in which case align is not deprecated. Except that the W3C would like HTML to be deprecated but thats never going to happen despite what some members of this forum would like. I'm not actually to sure that align is deprecated in XHTML for div tags, might be worth checking.

Narasinha
11-16-2003, 03:41 PM
As far as early browser visitors, I've had eleven page views simply reported as "Mozilla/3.01 (compatible;) this month. I even had one that said "Mozilla/2.0 (compatible; MS FrontPage 4.0)". I can't imagine how that looked. Last month I had one NS 4.7 page view. I've looked at my site with 4.7, and it's horrible. But, it's still usable. With its atrocious use of CSS, and dwindling number of users, I can't see any sense in attempting to satisfy its requirements with my site.


I have been using the "text-align;center" in my style sheets to little avail. It is works in one it fails in another. Sometimes it centres the block and other times is centers the text inside the block!

The "text-align: center" should work for most cases, but in other situations where I want to center a block element inside another block element, I've used "margin-left: auto; margin-right: auto" with some success.



I know you could of done padding: 0 50px 0 50px; but I can never remember which is which.

I always think of it like a clock. It goes clockwise from top: top - right - bottom - left.

carbonize
11-16-2003, 03:49 PM
I've had hits from NS3 but I've been informed this is usually when your site has been called in a frame. Never tested this theory though.

ranjan
11-16-2003, 06:37 PM
http://www.total-impact.com/reviews.php?op=showcontent&id=105

Altough the tutorial is about controlling div heights, it very briefly touches of centering a div horizontally and vertically in modern browsers

masterpeace
11-16-2003, 08:14 PM
Thanks guys,

The info you all gave was helpful. I was using "text-align:centre" & margin left & right with good results... until it hit my clients old netscape browser...

In the end I think I have to balance my desire to write clean code with the fact that I am not going to convince this client to update his browser, and in the end if it doesn't work on their browser then they will think I have done a shoddy job anyway...

You know those clients who ask all those technical questions as if they know all about computers but really know nothing... You give them the right answers but because they don't understand the basics they don't really understand the answers either.

This guy is really nice, but among other things he thought it was part of my job as a designer to search the entire web for other web sites that linked to their old web address (they only just got their own domain) and get the links updated. He also assumed I was going to write all their content etc... We started with a quote for a three page site and then he saw the draft and wasn't really happy. I thought he didn't like the design... it turned out he didn't like the content, which is their responsibility. He then wanted to add this that & the other and was surprised when I said, "sure but that isn't covered in the basic 3 page site you requested when we first talked"...

When "difficult" clients rude etc it is sometimes easier to cut your losses, but while these folks are a bit ignorant, they are actually nice people... Or maybe I am just a sucker...

It is definately another reason for me to start writing "educational" newsletters to my clients...