Noob HTML Questions

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

  1. ComicStix macrumors member

    Aug 29, 2009
    Boston, Massachusetts
    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

    Dec 1, 2008
    To embed a file, put this inside your html code, substituting the name of the file for your file.
    for a quicktime file:
    <center><object width="480" height="375" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase=""> <param name="src" value=""> <param name="controller" value="true"> <param name="autoplay" value="false"> <embed src="" width="480" height="375" autoplay="true" controller="true" pluginspage=""> </embed> </object>
    for a flash file:
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",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="">
    Hope this helps.
  3. ComicStix thread starter macrumors member

    Aug 29, 2009
    Boston, Massachusetts
    Thanks for the help!
  4. Dal123 macrumors 6502a


    Oct 23, 2008
    <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
    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 {
  5. Joined:
    Jun 30, 2009
    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,

    <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

    <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