I am working on cleaning up the code as per validation but the very first HTML problem it gives me is the <center> tag that aligns my 800px width design in the window.
The design is a table-based one because I build my image in PhotoShop and slice it in ImageReady which generates the HTML for it. I tweak as I go to make it work but I honestly do not know any way to ensure that my design displays mid-screen unless I use <center> tags in the body.
How would I make this happen using CSS? Every attribute I try doesn't have center as an option (like float which just makes sense that it should). I am completely baffled and I thank you for any education!
Kathy
7 1675
Thinking out loud after more consideration...
Do I use a body <div> that somehow uses a relative position? If so, what would it look like?
#bodyplcmt { position:relative; (but relative to what?!?)
I also get the feeling that, because I have no specified height for the table so that it stretches to accomodate all content, something in my CSS is breaking the table apart. Each table cell is valigned to top and has a specified height to avoid those breaks but they are now visible.
I wish I could just find these answers without asking and asking here! I hate deadlines!!! :)
Kathy
Kathy,
I just drank a wonderful wine on an empty stomach and I'm surprised my spelling is correct right now and I love you. Anyway, the center tag is deprecated so furgettabotit.
Never, ever design using tables. They are for data only and meant to be that way and have I said anything inappropriate yet?
Relative positioining will put the div relative to where it would normally go in the flow of the document.
If you want to center a div, try margin:0 auto;
Man this stuff is good but I'm wasted. Give me an hour.
Honestly, I'm not a drinker at all.
:) Your spelling is dandy!
Honestly, I really do want to learn how to get away from tables and I am really willing to learn. So far, I haven't found a 'Complete Moron's Guide to Not Using Tables Because They're Stoopit.' Unfortunately, I started doing this sort of stuff when tables were "THE WAY TO LAY OUT A PAGE" and those old habits refuse to go quietly into the night.
I think I'm going to spend the night playing with <div> tags. You just enjoy that wine!
Kathy
Paging Dr Howard... Paging Dr Fine...
Holy cannoli, Batman! Why didn't anyone tell me that this CSS stuff was so amazing?!? I have spent a bit of time redoing the site, eliminating the tables. So far, it's all going well except I'm having some trouble getting my background images to show.
Thank you for teaching me about the center alignment code! That gave me the courage to go 'all the way' as it were! I'm sure I still have plenty of questions and much work to do but I am doing a happy dance and keep saying out loud, "Oh my gosh! Look at that!"
Of course, there's always IE to battle...
Thank you more than you know,
Kathy
Throw your table inside a div.
Style the div. Set the margins as such
margin: 0 auto 0 auto;
You can play around with it, but essentially, it will centre the div horizontally because the left and right margin setting are set to auto.
The thing to remember with properties of CSS like this, are that when defining things like this in one statement, the order is -
property: top_value right_value bottom_value left_value;
She's trying to get away from using tables so just throwing them in a div is not appropriate.
Kathy, I have just the opposite experience. I had no interest in coding for the web until about two years ago. I have never used tables for layout and have a hard time helping people who do.
Thank you for the advice! I did read the margin order at one point and sort of chant to myself every time - "like a clock... "
Admittedly, I was quite nervous about letting go of my table security blanket but I am finding using CSS is really entertaining. I change a number here or move a <div> there and elements just slide around! It's really amazing!
I have a long way to go before I truly understand each tag and what it does. At this point, I'm a hacker, much like when I play around with php and perl.
I'm still being confounded by my background images but, at the moment I can proudly report that I validated my code in progress and got no errors on both the HTML and the CSS!
So far, so good! And, heck - I've got another day before the phone calls and emails start flying fast and furious... ;)
Thank you for all your help so far!
Kathy
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Erik Schulp |
last post by:
Hi all,
I am trying to get a CSS defined layout to center on the page, have
tried doing this with the <center></center> tags but than everything
is centered, including text etc etc.
What...
|
by: Charles Blaquière |
last post by:
As part of my explorations in liquid design, I'm exploring ways to use the
overflow: hidden property -- when browser windows become too narrow, I want
(some) images to get cropped rather than have...
|
by: Justin Archie |
last post by:
The subject says it all my friends. I have searched google to death
about centering problems and for some reason no one seems to have the
error I have. For the past few days I have been working on...
|
by: red |
last post by:
How do I center two side by side divs ?
I've been writing css pages for a while but there's one thing tha still
eludes me.
I can center a div with margin auto.
I can place two divs side by side...
|
by: wmasterj |
last post by:
I have a div
i want it to be max a certain width - thats done already
But - i want the empty sides of the div
to have the same width - like with frames (cols="*,800, *")
So no matter how much i...
|
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...
|
by: speralta |
last post by:
I'm playing around with a test page that uses a <div id="main"within
the context of a body with a width of 100% to center a fixed width
field on a page. For some reason, the page is not centering...
|
by: SAL |
last post by:
Hello,
is there a way to menu control dynamically center itself horizontally on a
page?
I have placed a menu control in a panel control (no ajax) and would like it
to center itself. Depending on...
|
by: =?Utf-8?B?ZnJhbmt5?= |
last post by:
Hello,
I've created a table that has two rows that are span across three columns.
The third row has three columns, each with an image. The last row is also
span accross three columns. The span...
|
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...
|
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: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |