Jump to content

Getting no response from some tags


Glom
 Share

Recommended Posts

I'm trying to put a title in the middle of its element, but the vertical-element attribute is having no effect.Here's what I'm doing.

h1   {   color:#000000;   font-family:sans-serif;   vertical-align:middle;   }

<div id="title"><h1>FREEDOM FOR FISSION<br />about the site</h1></div>

Similar problem with the min-height attribute. I want some divs to be the same height as their neighbours, but this isn't working.

.chapter   {   background-color:#CCFFCC;   width:32%;   border:1px solid;   font-size:85%;   min-height:100;   }

<div class="chapter" style="float:left">    <h1>SAFETY</h1>    <a href="saf/pollution.html">Radiation and pollution</a><br />    <a href="saf/reactor.html">What could go wrong?</a><br />    <a href="saf/terrorism.html">Weapons of terror</a><br />    <a href="saf/space.html">Nuclear power in space</a>  </div>  <div class="chapter" style="float:right">    <h1>APPENDICES</h1>    <a href="app/links.html">Nuclear power on the web</a><br />    <a href="app/glossary.html">Glossary</a><br />    <a href="app/calendar.html">Greenpeace calendar</a><br />    <a href="app/unscear.html">The Chernobyl report</a><br />    <a href="app/tmiruling.html">The TMI verdict</a>  </div>

Link to comment
Share on other sites

Yep these are well known problems with using divs. :) You can use margins to sort your alignment of the content.As for making all the divs the same legnth you carnt though you can make it look like it does using the faux coloumns method.

Link to comment
Share on other sites

Vertical alignment will only come into play if you set the height of the element. If you set the height of the element to 200px, and then write one line of text in it, you can use vertical alignment to say where the text shows up. But if you don't set the height, the element will only be as large as it needs to be (it will be the minimum height necessary), so vertical alignment doesn't have any effect.With regard to min-height, keep in mind that IE doesn't support min-height at all.

Link to comment
Share on other sites

Yep these are well known problems with using divs.  :) As for making all the divs the same legnth you carnt though you can make it look like it does using the faux coloumns method.

Actually you can make the divs the same length.you have to put those div in a container div though,and then for each div (the columns and the container) set the css to this:
#container{height:100px(or some hieght you know is smaller than you need); overflow:visible;}#col1{height:100%; overflow:visible;}#col2{height:100%; overflow:visible;}

that sould make them all the same length.LG

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...