Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: center-ing header

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

    Default center-ing header

    Hi, can anyone tell me how to center my title ?

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head><font size=5><b>Welcome to ITC<align ="center"/><b>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>dynamicMarquee</title>
    </head> 
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="900" height="400" id="dynamicMarquee" align="top">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="dynamicMarquee.swf" />
    <param name="quality" value="best" />
    <param name="scale" value="noscale" />
    <param name="bgcolor" value="#ffffff" />
    <embed src="dynamicMarquee.swf" quality="best" scale="noscale" bgcolor="#ffffff" width="550" height="440" name="dynamicMarquee" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    </body>
    </html>
    thanks

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Try this:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>dynamicMarquee</title>
    </head> 
    <body bgcolor="#ffffff">
    <h2 style="font-weight:bold;text-align:center">Welcome to ITC</h2>
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="900" height="400" id="dynamicMarquee" align="top">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="dynamicMarquee.swf" />
    <param name="quality" value="best" />
    <param name="scale" value="noscale" />
    <param name="bgcolor" value="#ffffff" />
    <embed src="dynamicMarquee.swf" quality="best" scale="noscale" bgcolor="#ffffff" width="550" height="440" name="dynamicMarquee" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    </body>
    </html>
    Last edited by Nile; 05-15-2008 at 01:48 AM.
    Jeremy | jfein.net

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

    Default

    Erroneous.
    This part should'nt be in the head section:
    Code:
    <font size=5><b>Welcome to ITC<align ="center"/><b>
    Also, these are deprecated
    To name of deprecated attributes and elements that you used:
    font
    align
    bgcolor
    The fix is to go through CSS:
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>dynamicMarquee</title>
    <style type="text/css">
    .header{
    font-size:20pt;
    font-weight:bold;
    text-align:center;
    display:block;
    }
    body{
    background:#fff;
    }
    </style>
    </head> 
    <body>
    <div id="wrap">
    <span class="header">Welcome to ITC</span>
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="900" height="400" id="dynamicMarquee" align="top">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="dynamicMarquee.swf" />
    <param name="quality" value="best" />
    <param name="scale" value="noscale" />
    <param name="bgcolor" value="#ffffff" />
    <embed src="dynamicMarquee.swf" quality="best" scale="noscale" bgcolor="#ffffff" width="550" height="440" name="dynamicMarquee" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    </div>
    </body>
    </html>
    Edit: Nile, you beat me through it


    ...also, Nile, you missed closing your h2 tag:
    Code:
    <h2 style="font-weight:bold;text-align:center">Welcome to ITC</h3>
    ...and closes it with the </h3> tag
    See if it helps
    Learn how to code at 02geek

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

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Lol, thanks. I'll fix it. You caught me
    Jeremy | jfein.net

  5. #5
    Join Date
    Mar 2008
    Posts
    222
    Thanks
    10
    Thanked 3 Times in 3 Posts

    Default

    Thanks Nile & rangana. Ya, my header is in the center . Now here another qns. What the difference between the html that both of you gave & the link that Medyman provides. the link generates the SWFObject v2.0 HTML & javascript generator

    Also, these are deprecated
    To name of deprecated attributes and elements that you used:
    Opps, I never notice. I just tried opening my .swf file add in the header.Thanks for the tip



    Code:
    <!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" lang="en" xml:lang="en">
    	<head>
    		<title></title>
    		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    		<script type="text/javascript" src="swfobject.js"></script>
    		<script type="text/javascript">
    			swfobject.registerObject("myFlashContent", "7.0.0");
    		</script>
    	</head>
    	<body>
    		<div>
    			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="myFlashContent">
    				<param name="movie" value="dynamicMarquee.swf" />
    				<!--[if !IE]>-->
    				<object type="application/x-shockwave-flash" data="dynamicMarquee.swf" width="800" height="600">
    				<!--<![endif]-->
    					<a href="http://www.adobe.com/go/getflashplayer">
    						<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
    					</a>
    				<!--[if !IE]>-->
    				</object>
    				<!--<![endif]-->
    			</object>
    		</div>
    	</body>
    </html>

  6. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Hyk...

    SWFObject only embeds the flash portion. The CSS that Nile and Rangana gave you were to center your title. They serve two different purposes.

    The HTML & Javascript that the SWFObject generator generates relates to adding the .swf to your webpage, nothing else.

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

    Default

    Quote Originally Posted by hyk View Post
    Thanks Nile & rangana. Ya, my header is in the center . Now here another qns. What the difference between the html that both of you gave & the link that Medyman provides.
    Medyman had explained the purpose of SWF generator, now my turn is to explain the difference between mine and Nile's code

    Our codes differ, but with the same purpose - to center the title

    Nile gave you a code using h2 element which is a block level element by default.

    I gave you a code using span element which is an inline element, but then is displayed as block level element using:
    Code:
    display:block;
    ...for centering mechanism, we both used text-align:center to achieve this.

    ...One thing that Nile missed is to change the bgcolor attribute which is deprecated

    ...Also, I placed all of your elements inside a wrapper (div) for validation purposes
    Learn how to code at 02geek

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

  8. #8
    Join Date
    Mar 2008
    Posts
    222
    Thanks
    10
    Thanked 3 Times in 3 Posts

    Default

    SWFObject only embeds the flash portion. The CSS that Nile and Rangana gave you were to center your title. They serve two different purposes.
    The HTML & Javascript that the SWFObject generator generates relates to adding the .swf to your webpage, nothing else.
    If i just want to show a sample on how it is going to look like, this is the correct way to embed. right? If i want to add in some words,background where do i add it?

    Thanks for the tip rangana

    ps: Nile, rangana& medyman. I not sure if the question i asking you guys is html or a flash-type.I quite confused by it

  9. #9
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    If i want to add in some words,background where do i add it
    You know HTML, right? Just as it like you normally would. There is nothing special about that page. The Flash embed code is just another element. Add your words above it, below it..whatever

    Background etc.. styling can be done via CSS.

    ps: Nile, rangana& medyman. I not sure if the question i asking you guys is html or a flash-type.I quite confused by it
    Your question is HTML/CSS related. The use of SWFObject in what you're trying to do (add text and styling) has no bearing.

  10. #10
    Join Date
    Mar 2008
    Posts
    222
    Thanks
    10
    Thanked 3 Times in 3 Posts

    Default

    here the html.. i changed the name of the swf, sizes, delete the <a herf> tag. The sizes, i not too sure. since IE6 & IE7 they give very varying results It tried it with FF. Its looks like a full-screen flash player.
    LOL, the good influence from you guys is great. I would had just tried 1 ver of IE and give up. Looking at posts made me tried on other browsers. Thanks

    Code:
    <!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" lang="en" xml:lang="en">
    	<head>
    		<title></title>
    		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    		<script type="text/javascript" src="swfobject.js"></script>
    		<script type="text/javascript">
    			swfobject.registerObject("myFlashContent", "9.0.0");
    		</script>
    	</head>
    	<body>
    		<div>
    			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1000" height="600" id="myFlashContent">
    				<param name="movie" value="dynamicMarquee.swf" />
    				<!--[if !IE]>-->
    				<object type="application/x-shockwave-flash" data="dynamicMarquee.swf" width="1000" height="600">
    				<!--<![endif]-->
    					
    				<!--[if !IE]>-->
    				</object>
    				<!--<![endif]-->
    			</object>
    		</div>
    	</body>
    </html>
    Last edited by hyk; 05-15-2008 at 02:28 PM.

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
  •