Advanced Search

Results 1 to 2 of 2

Thread: centre a piece of text within a div

  1. #1
    Join Date
    Jan 2012
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default centre a piece of text within a div

    I know theres no real way of doing this but you have to improvise

    so i have numbers 1 to 7 on a new line and want to centre that paragraph within a div. Now i got it to work but there seems to be alot of white space below the number 7 where i have not indicated any text or line breaks etc... so what is this white space that is causing the scroll bar to appear

    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML><HEAD>
    <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8">
    <META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="en-UK">
    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="PUBLIC">
    <TITLE>New Project</TITLE>
    <style type="text/css"> .divScrollAuto {overflow:auto;    white-space:nowrap;}</style>
    <script type="text/javascript" src="crawler.js"></script>
    </HEAD><BODY style="width: 1000px;height: 1000px;background-color: #FFFFFF; ">
    
    <DIV id="newdiv1"  title="" align="center" style="border: 1px solid #000000 ;overflow:auto;   top: 100; left: 500; 
    
    position: absolute; z-index: 101; visibility: show; background-color: transparent; width: 185px; height: 247px; font-size: 
    
    20pt; font-family: TIMES NEW ROMAN; color: #000000;"><p style="position: relative;top: -20; padding-top: 
    
    10;">1<BR>2<BR>3<BR>4<BR>5<BR>6<BR>7</p></DIV>
    
    
    </BODY></HTML>

  2. #2
    Join Date
    Jan 2012
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oh sorry i think i may have sorted it

    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <
    HTML><HEAD>
    <
    META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8">
    <
    META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="en-UK">
    <
    META HTTP-EQUIV="CACHE-CONTROL" CONTENT="PUBLIC">
    <
    TITLE>New Project</TITLE>
    <
    style type="text/css"> .divScrollAuto {overflow:auto;    white-space:nowrap;}</style>
    <
    script type="text/javascript" src="crawler.js"></script>
    </HEAD><BODY style="width: 1000px;height: 1000px;background-color: #FFFFFF; ">
    <DIV id="newdiv1"  title="" align="center" style="border: 1px solid #000000 ;overflow:auto;   top: 100; left: 500; 

    position: absolute; z-index: 101; visibility: show; background-color: transparent; width: 185px; height: 247px; font-size: 

    20pt; font-family: TIMES NEW ROMAN; color: #000000;"><div style="position: relative;top: 

    10;">1<BR>2<BR>3<BR>4<BR>5<BR>6<BR>7</div></DIV>
    </BODY></HTML> 

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
  •