Noob HTML Questions

Discussion in 'Web Design and Development' started by ComicStix, Sep 2, 2009.

  1. ComicStix macrumors member

    Joined:
    Aug 29, 2009
    Location:
    Boston, Massachusetts
    #1
    Span and div elements? What are these? I hear them a lot and I have no idea what they are or how to use them.

    Second how would I embed a movie in my website? I want the quicktime movie to load and then auto play.

    Also, should I use padding to center text or text-align:"center"? What is padding for? Margins?
     
  2. captainmeowtron macrumors member

    Joined:
    Dec 1, 2008
    #2
    To embed a file, put this inside your html code, substituting the name of the file for your file.
    for a quicktime file:
    Code:
    <center><object width="480" height="375" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> <param name="src" value="yourfile.mov"> <param name="controller" value="true"> <param name="autoplay" value="false"> <embed src="yourfile.mov" width="480" height="375" autoplay="true" controller="true" pluginspage="http://www.apple.com/quicktime/download/"> </embed> </object>
    for a flash file:
    Code:
    <center>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="1100" height="800">
    	<param name="movie" value="yourfile.swf">
    	<param name="quality" value="high">
    	<param name="bgcolor" value="#000000">
    	<embed name="file" src="yourfile.swf" width="1100" height="800" quality="high" bgcolor="#000000" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
    </object>
    Hope this helps.
     
  3. ComicStix thread starter macrumors member

    Joined:
    Aug 29, 2009
    Location:
    Boston, Massachusetts
    #3
    Thanks for the help!
     
  4. Dal123 macrumors 6502a

    Dal123

    Joined:
    Oct 23, 2008
    Location:
    England
    #4
    <div id="logo"> this is the start tag and needs a closing tag </div>. There are different things not just id's one is class <div class="logo" difference between id and class is that class can be used infinite amount of times, id just once. Check out www.w3schools.com.
    Not sure about <span> haven't had to use it yet.:)
    Padding is an invisible gap like you guessed to space, I think margin is similar (I don't fully understand as you can see I'm complete novice) and to center text you want to format it in your css (external style sheet) as
    p {
    text-align:center;
    }
     
  5. Joined:
    Jun 30, 2009
    #5
    A DIV tag divides the page into, say, areas of interest. For example, say you want to divide the page's layout into a header, a sidebar, a main content, and a footer. You'd write, combining HTML with CSS,

    HTML:
    <div id="header"> </div>
    <div id="sidebar"> </div>
    <div id="main"> </div>
    <div id="footer"> </div>
    
    The SPAN is mainly used for editing small bits of your web page. Think of the following sentence: The quick brown fox jumps over the lazy dog. Say you want to highlight the words describing the two animals, in a complex way, which requires some CSS (think underline and highlight in different colors each, as well as bold and italic :) ). You'd write

    HTML:
    <p>The <span style="background-color: red; text-decoration: underline; font-weight: bold; font-style: oblique;">quick</span> brown fox jumps over the <span style="background-color: red; text-decoration: underline; font-weight: bold; font-style: oblique;">lazy</span> dog</p>
    
    If you want to have a better idea of how embedding works, have a look here.

    As long as text-align: center (without any quotes, they are only used when more than one word is required in order to define a value) is supported in CSS 2.1, go ahead and use that if don't need the extra control granted by padding. Again, according to W3Schools, "The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent.", while "The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.".

    You'd want to bookmark W3Schools -- a very useful beginner's resource
     

Share This Page