html - Percentage of height not working for portrait screen orientation -
I am trying to determine the percentage of 2 div elements (main and headers) in the body of html. The problem is that it is not working (the percentage of the height displayed is incorrect) when my screen is the orientation picture. Example dimension I see below:
320x480
320x568
600x800
768x1024
800x1280
I use to check my code.
HTML code:
& lt; body & gt; & Lt; Header & gt; & Lt; Div id = "title" & gt; Just a title & lt; / Div & gt; & Lt; / Header & gt; & Lt; Main & gt; Here the main division element & lt; / Main & gt; & Lt; / Body & gt; CSS code:
html, body {background-color: # A8F000; Height: 100%; } Header {background-color: # F80012; Height: 25%; } Main {Background color: # 009 E8E; Height: 70%; } What's going wrong here?
Use this:
header {background color: # F80012 ; Height: 25%; } Add
Comments
Post a Comment