dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: How can I center the script?

  1. #1
    Join Date
    Jan 2014
    Posts
    11

    Cool How can I center the script?

    Hello everybody! Someone of you know how to center the screen as well as I show you the code. Will you help me to use a style sheet properly in the center please?

    <style type="text/css">
    #quote { /*style for quote division*/
    position:relative;
    width:375px;
    height:70px;
    border:1px solid black;
    font-family:sans-serif;
    font-size:95%;
    padding:3px;
    background-color:lightyellow;
    }
    #auth { /*style for quote author, if any*/
    position:absolute;
    bottom:3px;
    right:10px;
    }
    </style>

  2. #2
    Join Date
    Jan 2014
    Posts
    11

    Thumbs up I solved

    It was very easy but it took me long time to focus trying to find out how to center the script.

    The answer was to look whole script that relate to the quote screen, then before the script type <center> and in the end of the script type </center> .. it solved!

    just <center> ... </center>

  3. #3
    Join Date
    Sep 2006
    Location
    new york
    Posts
    267
    Unfortunately, the <center>tag</center>is now deprecated, as is align="center" for HTML5.

    See http://www.w3.org/Style/Examples/007/center.en.html for "Centering things" or http://designshack.net/articles/css/...hing-with-css/ or http://webdesign.about.com/od/beginn...a/aa012207.htm or

  4. #4
    Join Date
    Jan 2014
    Location
    Boston, Massachusetts
    Posts
    66
    What exactly do you want centered? You could try
    body {
    margin:auto;
    }

    or
    #quote, #auth {
    text-align:center;
    }

    Also, I would change those ids to classes if you'll be using them more than once.
    e.g. <div class="auth">

  5. #5
    Join Date
    Jan 2014
    Location
    Boston, Massachusetts
    Posts
    66
    ...and if you change them to classes, then it would be .quote and .auth instead of #quote.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles