473,787 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS vertical alignment

56 New Member
Here is a link to the page in question:
http://test.fether.net/pagelayout.php

I want the three boxes inside the gold area to all be tight against the top of it.

In Safari, the boxes are where I want them, but in Firefox on the Mac and both Firefox and IE on the PC, all three boxes are down about a quarter inch. I listed the CSS code on the bottom of that page, can anyone tell me why the boxes aren't going where they should? Thanks in advance.
Mar 11 '06 #1
5 8439
Banfa
9,065 Recognized Expert Moderator Expert
This is a common problem when trying to layout pages, there is nothing wrong with the layout of your tags and your CSS, the problem lies in the white space you have put in the file.

In this case the specific problem is the first   The space you see the the space required to display that space that you have said can not be modified, remove it and the gap disappears.

In extreme cases it has been necessary to remove the normal spaces and newlines between tags to get a page to display as required on all browsers.

In some cases use of the CSS "overflow: hidden;" can be of use.
Mar 12 '06 #2
webhead
56 New Member
Thanks, all better now. I don't know why that   was there at all, or how I missed it. Sometimes you just need another pair of eyes. Thanks again.
Mar 12 '06 #3
webhead
56 New Member
Similar problem, but I don't have any errant   laying around:

http://www.test.fether.net/WebSlinger/login.php

Firefox on PC and Safari on Mac put the body tight against the header box.
IE on PC puts a very small gap between the header box and the body.
Firefox on Mac puts a large gap between the header box and the body.

The header box is in a division and the body box is in the very next div, nothing between. The CSS for the two divs is:
Expand|Select|Wrap|Line Numbers
  1. #headbox {
  2.     margin-left: auto; margin-right: auto; margin-top: 0px; margin-bottom: 0px;
  3.     width: 780px; height: 159px;
  4.     text-align: center;
  5. }
  6. #pagebox {
  7.     width: 780px;
  8.     margin-left: auto; margin-right: auto; margin-top: 0px; margin-bottom: 0px;
  9.     border-width: 0px 2px 0px 2px; border-style: ridge; border-color: pink;
  10.     background-image: url(../images/WSbktile.jpg);
  11.     text-align: center;        /* for IE which ignores auto */
  12. }
  13.  
  14.  
Any ideas?
Mar 31 '06 #4
Banfa
9,065 Recognized Expert Moderator Expert
The problem is in the html you do have an errant space (not a &nbsp; just a normal space) between the the end of the image tag and the closing </div> tag in the head box.

[html]
<div id="headbox"><i mg ... > </div>
^
Here
[/html]

BTW did you know that

margin-left: auto; margin-right: auto; margin-top: 0px; margin-bottom: 0px;

could be written

margin: 0px auto;

This has 4 general forms

margin: <AllMargins>;

margin: <TopBottomMargi ns> <LeftRightMargi ns>;

margin: <TopMargin> <LeftRightMargi ns> <BottomMargin >;

margin: <TopMargin> <RightMargin> <BottomMargin > <LeftMargin>;


Also works for padding.
Mar 31 '06 #5
webhead
56 New Member
Ah, thanks. It's one of those little things like not having any space around textarea tags, took me quite a while to find that one out. Dang details.

Somewhere I found a page that tells of all the CSS shortcuts, but sometimes I just don't feel like looking it up right away. Now I don't have to! Thanks!
Mar 31 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
30912
by: abracad | last post by:
Hi Is it possible to vertically align an image in the middle of a DIV of fixed height?
10
66050
by: Markus Ernst | last post by:
Hi I have a strange problem with vertical-align. The case can be viewed at http://www.brainput.info/geschichte.html. HTML code: <div id="bild"><img src="geschichte.gif" width="274" height="29" alt="Wir schreiben die Geschichte Ihres Unternehmens."></div>
3
4285
by: Frank Wheeler | last post by:
Why am I unable to attain proper vertical alignment between a DIV and a TABLE here: http://www.whbvillage.com/agenda-archives/agendex.html The DIV is coded: <DIV style="float: left; background: transparent; color: #000099;
1
7902
by: Kenneth | last post by:
Okay, I've been scouring Google for hours looking for a solution to this problem, but as of yet I can't find one. XHTML Transitional seems to specify that I can no longer set a table's height to 100% and vertically center content inside of it. Therefore, I'm seeking a way, preferably in CSS to vertically center a site. Here's more of a visual to what I have: /********************************
5
10062
by: Rico | last post by:
I have label that I need to be vertical. The problem is that when I select "Vertical=yes" the label reads from top to bottom rather than bottom to top (which i need). Can this be done? Any help would be great. Thanks!
6
7873
by: Andy Mabbett | last post by:
Please can someone remind me of the most elegant fix for the way Firefox fails to vertically align cell content by default? For example, the second event on: http://www.westmidlandbirdclub.com/diary/ Thank you. --
11
19229
by: C.W.Holeman II | last post by:
I what to hide an input element and the following text. I have the selector for the input working and just need to grab the text following it. CSS: form{ display:table; text-align:center; }
2
15569
by: esteuart | last post by:
I need to get the right combination for a div to clip any text inside and allow vertical alignment. I only have this problem in FireFox. I have 3 divs nested within each other. The outer div has display of table, the first inner div has display of table-cell and the inner-most div has the text. The outer div has a set width and height. So here's the problem: Without the inner divs having a width and height set, the overflow:hidden doesn't...
8
3554
by: ayamopamo | last post by:
Hi- I am trying to center a web page. It seems like this should be very simple to do, but apparently it isn't my day. I have successfully centered the background by calling it in the css body tag: body { font-family: Trebuchet MS, Arial; cursor : default; background:#000000 url("Images/long-template.jpg"); background-repeat:no-repeat; background-position: center; background-attachment:scroll; height: 1228px;
13
1662
by: Bill | last post by:
Hi How can I have IE7 act correctly on that ? The rules make the link text go down when hovered. It works in FF , I had to add a hard space right after the LI tag to have OP9 work but I can't figure how to have IE7 work. Why? How can I have it work in all 3 browsers? http://nrap.selfip.com
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10169
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.