473,418 Members | 2,052 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,418 software developers and data experts.

vertical align with not specified height

I am trying to put together an login page my problem is getting the three items aligned to the middle verticaly without specifing a height to anything on the page.

CSS

html{
height:100%;
min-height:100%;
}
body{
vertical-align:middle;
background-color: #FFFFFF;
text-align: center;
height:100%;
min-height:100%;
margin:0px 0px 0px 0px;
padding:0px 0px 0px 0px;
}

.loginHeader{
background-color:#4F4F4F;
text-align:center;
vertical-align:middle;
font-family:Verdana;
font-size:14px;
color:White;
font-weight:bold;
position:relative;
}
.loginFooter{
background-color: #4F4F4F;
height: 20%;
text-align: center;
vertical-align: middle;
position: relative;
}
.loginMain{
background-color: #E4E0DF;
height: 60%;
text-align: center;
vertical-align: middle;
position: relative;
}
.loginBox{
text-align:center;
border: solid 1px #4F4F4F;
width: 250px;
height: 200px;
display: table-cell;
margin-right: auto;
margin-left: auto;
vertical-align: middle;
}
.vertAlign{
left: 0px;
top: 50%;
display: table-cell;
vertical-align: middle;
}


.alpha1{
background-color:#4F4F4F;
max-height:30%;
min-height:10%;
}
.alpha2{
background-color:#E4E0DF;
max-height:30%;
min-height:10%;
}
.alpha3{
max-height:60%;
min-height:40%;
}

.bravo1{
height: 20%;
background-color: #4F4F4F;
text-align: center;
vertical-align: middle;
}
.bravo2{
height: 60%;
background-color: #E4E0DF;
text-align: center;
vertical-align: middle;
}

original code

<body>
<div class="loginHeader">Verve Records<br />www.celebrateella.com</div>
<div class="loginMain">
<div class="loginBox">test</div>
</div>
<div class="loginFooter">
<div class="vertAlign"><a href="http://www.default.com" target="_blank"><img src="Images/Logos/default.gif" alt="default" width="127" height="39" style="border: 0px; position: relative;" /></a></div>
</div>
</body>

my code

<body>
<div align="center" class="bravo1">
<div align="center" class="alpha1"></div>
<div align="center" class="alpha3">
<div align="center" class="loginHeader">Verve Records<br />www.celebrateella.com</div>
</div>
<div align="center" class="alpha1"></div>
</div>
<div align="center" class="bravo2">
<div align="center" class="alpha2"></div>
<div align="center" class="alpha3">
<div class="loginBox">test</div>
</div>
<div align="center" class="alpha2"></div>
</div>
<div align="center" class="bravo1">
<div align="center" class="alpha1"></div>
<div align="center" class="alpha3">
<div align="center" class="vertAlign"><a href="http://www.default.com" target="_blank"><img src="Images/Logos/default.gif" alt="default" width="127" height="39" style="border: 0px; position: relative;" /></a></div>
</div>
<div align="center" class="alpha1"></div>
</div>
</body>

I got it to sort of work right in my code but the boss wants it in as few lines an styles as possiable so is there a way to align the three items to the center verticaly while useing a %height and not a hard pxheight. The idea is that the items stay in the middle horizontaly and verticaly no matter the size of the browser.

Any help is much apreceated

ps this is my first post here
Jun 1 '07 #1
3 4388
drhowarddrfine
7,435 Expert 4TB
Could you be a little more specific about "the three items". I see the text and I guess you maybe use some divs with borders. I'm not sure what I'm looking at though I haven't studied the code.

Divs are for structure and not presentational elements themselves. Once I know exactly what the three items are supposed to be then this should be easy.
Jun 1 '07 #2
the graphic at the top is just two lines of text the box that goes in the middle will be made into a log in box later down the road and the in the bottem is a company graphic /link
Jun 3 '07 #3
it does not have to be done entirly in divs but it can not use any tables at all.
Jun 4 '07 #4

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

Similar topics

3
by: kAldam | last post by:
I am currently using IE 6.0 and 5.5 and the scenario is the following. I have a span that contains text, and the span is beign contained by a table cell (this is the way thing need to be in my...
8
by: abracad | last post by:
Hi Is it possible to vertically align an image in the middle of a DIV of fixed height?
10
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"...
1
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...
5
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up...
2
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...
8
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:...
13
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...
40
by: maya | last post by:
hi, how do I get text to vertical-align inside a div? http://www.mayacove.com/misc/home.html vertical-align should work, according to this:...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.