Results 1 to 5 of 5

Thread: CSS & DIV Help !!

  1. #1
    Join Date
    Mar 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CSS & DIV Help !!

    Hello Everybody !

    actually i have jst started using css and div tags and i getting difficult to use it .. if any one can temme wer can i get complete reference of CSS and DIV tags.

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    http://www.htmldog.com/reference/cssproperties/

    Div is just a block level element like <p> browsers usually place a line break before and after a div element.

  4. #4
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Usually? No, always. <div> and <p> tags automatically have display:block; embedded, so they will always have a line break before and after.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  5. #5
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    As I've mentioned by default div is a block level element without any doubt. But it is possible to convert a block level element like a div element to an inline element using CSS.

    In such situation if the user have to examine both CSS and (X)HTML source to find which are acting as full-fledged block level elements and as inline elements.

    So in order to avoid such confusion in such situations I've phrased it as "usually".

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    	<head>
    		<title> </title>
    		<style type="text/css">
    		.inlinediv{
    			display: inline;
    		}
    		</style>
    		<script type="text/javascript">
    		
    		</script>
    	</head>
    	<body>
    		<div>Test </div>
    		<span>This is a </span><div class="inlinediv">test</div>
    	</body>
    </html>
    In the above case the highlighted <div> element will not have any preceding and succeeding line breaks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •