473,385 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

beginning css: setting block widths for multi-browser compatability?

Hi, I'm just beginning CSS based web development and although I've been
bashing away at it since yesterday, I'm still stuck with positioning
things on pages.

I'm trying to make (in table-speak) two (or possibly more later) rows
each of three columns, with a table width 60% of the width of the
screen with a 10% left hand margin. I've been bashing away at the CSS
for a while now, and I'm almost there (except I can't get the top-edge
of the elements in each row to line up properly), but my main problem
is that as soon as I resize the fonts in my web-browser, the HTML
elements can start breaking out of the CSS boxes - and then HTML
elements start overlapping other HTML elements.

For example, here is what I've got so far:
http://www.dingnet.org.uk/~saxm/css_problem/p1.html

and the CSS is at:
http://www.dingnet.org.uk/~saxm/css_problem/p1.css

If you try increasing font sizes, you'll see the problem.

I really want the CSS boxes to be the same size as the HTML elements
they enclose, except in the case of column widths, where the columns
should be the same width as the largest HTML element in that column.
Does anyone have any tips on how I could go about doing this?

Cheers,

Steve

Jun 3 '06 #1
2 1483
To further the education of mankind, sa*****@dingnet.org.uk vouchsafed:
Hi, I'm just beginning CSS based web development and although I've been
bashing away at it since yesterday, I'm still stuck with positioning
things on pages.

I'm trying to make (in table-speak) two (or possibly more later) rows
each of three columns, with a table width 60% of the width of the
screen with a 10% left hand margin. I've been bashing away at the CSS
for a while now, and I'm almost there (except I can't get the top-edge
of the elements in each row to line up properly), but my main problem
is that as soon as I resize the fonts in my web-browser, the HTML
elements can start breaking out of the CSS boxes - and then HTML
elements start overlapping other HTML elements.

For example, here is what I've got so far:
http://www.dingnet.org.uk/~saxm/css_problem/p1.html

and the CSS is at:
http://www.dingnet.org.uk/~saxm/css_problem/p1.css

If you try increasing font sizes, you'll see the problem.

I really want the CSS boxes to be the same size as the HTML elements
they enclose, except in the case of column widths, where the columns
should be the same width as the largest HTML element in that column.
Does anyone have any tips on how I could go about doing this?


If you really need a table-layout, use a table.

If what you meant in the last paragraph is something like '...the columns
should be the same width as the largest of the columnar content widths',
this can be accomplished by determining the width in em of said content and
applying it to all relevant containers.

--
Neredbojias
Infinity has its limits.
Jun 3 '06 #2
sa*****@dingnet.org.uk wrote:

I'm trying to make (in table-speak) two (or possibly more later) rows
each of three columns, with a table width 60% of the width of the
screen with a 10% left hand margin. I've been bashing away at the CSS
for a while now, and I'm almost there (except I can't get the top-edge
of the elements in each row to line up properly), but my main problem
is that as soon as I resize the fonts in my web-browser, the HTML
elements can start breaking out of the CSS boxes - and then HTML
elements start overlapping other HTML elements.
Search for "two column css". You get lots of links.
If you try increasing font sizes, you'll see the problem.

I really want the CSS boxes to be the same size as the HTML elements
they enclose, except in the case of column widths, where the columns
should be the same width as the largest HTML element in that column.
Does anyone have any tips on how I could go about doing this?

Use ems for width specification, not %. That way the dimensions adapt to
the font size.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jun 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Robert Bowen | last post by:
Hello all. I have been given mock-ups (in static HTML) of some pages for a site I am working on. The client would like these pages to look exactly as they do now. The problem is that the content is...
2
by: TAM | last post by:
Hi, I have redesigned one html page by removing all the tables. You can see this test page at http://www.ngrain.com/css/home1.htm. Only home1.htm has been redesigned without tables. Rest of...
5
by: javaguy | last post by:
I have a data entry web application that is formatted heavily with tables. Having learned a bit of CSS, I'm hoping to rewrite this using <div> tags. But I have run into a formatting problem that...
4
by: hiazle | last post by:
I have a Page that has one left div with id "sidebar", floats left and has a fixed width of 140px, then another div with id "content", a left margin of 160px, and a fixed width of 570px. Here is...
24
by: fehays | last post by:
Hello, I'm having a problem with the css hover effect in IE. I have an <a> tag with the following CSS: a.subNavItem { display:block; color:#464645; padding:2px 7px 4px 6px;...
6
by: Goofy | last post by:
Hi People, Just wondered how you guys deal with the complex issue of CSS Styles for Complex server controls like the GridView. I know its a breeze to set up the styles for AlternatingRowStyles...
28
by: eastcoastguyz | last post by:
I'm a newbie to CSS, so be kind. :-) I have looked at examples of CSS and have not seen this yet. How can you change the colors of the text in the same word in CSS? For example, when how can you...
7
by: drum118 | last post by:
Trying to make some CSS buttons, but they fall apart in Firefox and IE. The first set of buttons work fine in IE, but in Firefox they double in size when mouseover. The second set is too wide...
9
by: Marky1124 | last post by:
Hi, I am hoping that someone can offer me some advise. I am new to CSS layouts and I've struggled to produce the screen layout that I wanted. Here's my demonstration page:- ...
19
by: Jim | last post by:
Hi, I have two questions/problems pertaining to CSS horizontal dropdown menus and am hoping that someone here can help me out. (1) I'm having a problem centering the menu. I picked up the...
1
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
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...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.