Results 1 to 4 of 4

Thread: Countdown coding....

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

    Default Countdown coding....

    i know this may seem simple, but i got this code from this website. I want to have the colored background centered to the page. I cant figure out how to change it. Can anyone help? Following is the link for the code i got from this site. Thanks in advanced


    http://dynamicdrive.com/dynamicindex6/dhtmlcount.htm

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This is easy, just enclose the entire thing in a centered element. For example:

    HTML Code:
    <div align="center">put the script and its ilayer here</div>
    You could use <p align="center"></p> as well, or get even more creative and stick the thing somewhere inside a table. Just make sure that wherever you put it, you allow enough horizontal space for its width.

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    HTML Code:
    <div align="center">put the script and its ilayer here</div>
    Just so you know, the preferred way to centre content is to set equal margins on the element:

    Code:
    .centred {
      margin: 0 auto;
      width: ??;
    }
    HTML Code:
    <div class="centred">...</div>
    The align attribute and the center element are deprecated. The latter was never really very good at centring due to various interpretations of a rather vague specification. The align attribute is equally vague, which is why it too should be dropped.

    See a recent discussion in Usenet.

    Mike

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Thanks, like the questioner in the link you supply, I too have wondered what the applicable method would be as we blithely deprecate <center> and align="center". Seems it is a work in progress, interesting though.

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
  •