AnuMohan Posted November 22, 2013 Share Posted November 22, 2013 Need a help in using CSS with PHP FileI created a Php File to create Div's (three blue boxes) and I want to align the boxes to the centre of the browser in a same row.My Php File is "index.php"<!doctype html><head> <title>Test</title> <link rel="stylesheet" href="stylesheet.css"/></head><body> <div id=”Container”> <div id="left"></div> <div id="center"></div> <div id="right"></div> </div></body></html> My CSS File is "Stylesheet.css"#Container{margin: auto;width: 1200px;}#left{ background-color: blue; height:300px ; width: 300px; float:left; margin-right: 10px; margin-left: 10px;}#center{ background-color: blue; height:300px ; width: 300px; float:left; margin-right: 10px; margin-left: 10px;}#right{ background-color: blue; height:300px ; width: 300px; float:left; margin-right: 10px; margin-left: 10px;}I have tried to remove "float: left;", but then boxes are coming one by one in the next row, I mean not in the same row.Please help. I want to know how to align it in the same row to the centre of the website.Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/284183-need-help-in-aligning-dic-to-the-centre-of-browser/ Share on other sites More sharing options...
Irate Posted November 22, 2013 Share Posted November 22, 2013 #container needs to have a fixed position and needs to have a centered vertical align, then you could set the width property of #container div to 33.3% I'm not an expert at CSS, but that should be about it. Link to comment https://forums.phpfreaks.com/topic/284183-need-help-in-aligning-dic-to-the-centre-of-browser/#findComment-1459618 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.