Format problem(navigation bar appears in the left and main body of content/section ap

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ppanchi
    New Member
    • Jul 2015
    • 1

    Format problem(navigation bar appears in the left and main body of content/section ap

    I am using navigation and section tags. The navigation bar appears on the right and the section(main body/content) which has to appear in th center appears on the leftof the screen/navigation bar. I am not able to correct that. Please help me!
    This is the code I used for it. Though I changed the float it doesnt work

    Code:
    nav {
    	background-color:rgba(222,184,135,0.5);;
    	/*margin:5px;*/
    	font-size:20px;
    	line-height:30px;
    	height:443px;
    	width:100px;
    	float:left;
    	text-align:left;
    	padding:5px;	      
    }
    
    section{
    	width:300px;
    	float:inherit;
    	*/text-align:center;*/
    	padding:10px;	 	 
    }
    Last edited by Rabbit; Jul 5 '15, 03:37 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • computerfox
    Contributor
    • Mar 2010
    • 276

    #2
    Normally when using float with two objects in the same container, they will usually go left and right, so your CSS is doing it correctly.

    You can try to add
    Code:
    clear:both;
    to your nav, but I have a strong biased against the current structure.
    I would use a separate div container and use two divs for those two objects. All browsers support divs, while some might not support "nav" and "section".

    Comment

    Working...