lovelyjitu Posted November 6, 2007 Share Posted November 6, 2007 Hi, Anybody tell me plz why we use div in php and for which perpose it is used in php and explain it by using a coding. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/76180-why-we-use-div-function/ Share on other sites More sharing options...
roopurt18 Posted November 6, 2007 Share Posted November 6, 2007 Do you mean division or the <div> markup tag? Quote Link to comment https://forums.phpfreaks.com/topic/76180-why-we-use-div-function/#findComment-385528 Share on other sites More sharing options...
lovelyjitu Posted November 6, 2007 Author Share Posted November 6, 2007 Yes <div> </div> Quote Link to comment https://forums.phpfreaks.com/topic/76180-why-we-use-div-function/#findComment-385530 Share on other sites More sharing options...
ToonMariner Posted November 6, 2007 Share Posted November 6, 2007 thats not php - its (x)html. a div difines a divide - this allows you to group contentent on the page. ie <div id="navigation"> could contain all your html for your navigation.. the beauty of it all is that if you have your content grouped like this you can place it anywhere you want on teh page with css. Quote Link to comment https://forums.phpfreaks.com/topic/76180-why-we-use-div-function/#findComment-385692 Share on other sites More sharing options...
dewey_witt Posted November 10, 2007 Share Posted November 10, 2007 I think a clearer explanation of what toon is trying to say is that by useing the <DIV> tags you can call your CSS for that division. Makes it easier when updating sites etc. EXAPMLE: html: <div id=output> Some output </div> CSS: #output { width: 350px; color: red; font-style: Juice ITC; } This calls the CSS for the div with the ID "output" then you set all your perameters for the div in css. see easy. (you can also call css styles inside the div tag with "<div style="width: 350px;>"" etc. hope I helped. Quote Link to comment https://forums.phpfreaks.com/topic/76180-why-we-use-div-function/#findComment-388371 Share on other sites More sharing options...
giggsmash Posted November 12, 2007 Share Posted November 12, 2007 <div> tag to group block-elements to format them with styles. This is some text <div style="color:#FF0000;"> <h4>This is a header in a div section</h4> <p>This is a paragraph in a div section</p> </div> output This is some text This is a header in a div section This is a paragraph in a div section Quote Link to comment https://forums.phpfreaks.com/topic/76180-why-we-use-div-function/#findComment-389863 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.