Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Closed Thread
How to Align a DIV Tag to Center
Old 06-24-2010, 05:01 PM How to Align a DIV Tag to Center
Experienced Talker

Posts: 31
Name: E.Karnika Yashwant
Trades: 0
Hello Guys,

I have made some page with nested div's. I made it's width to 80%. I want that to be completely aligned to center of the page. I tried with css and with html and with parent div. But some thing makes it not to work. Can you see the below code and please suggest me to get that to center.

HTML Code:
<style type="text/css">
.nm-left { text-align:left; vertical-align:text-top; }
.nm-left .nm-video, .nm-right .nm-video-reverse, .nm-left .nm-avatar,   .nm-left .nm-avatar-wrapper, .nm-left span.nm-button, .nm-left  #user-form input#submit { float:left; }
.nm-right { text-align:right; vertical-align:text-top; }
.nm-right .nm-video, .nm-left .nm-video-reverse, .nm-right .nm-avatar,  .nm-right .nm-avatar-wrapper, .nm-right span.nm-button, .nm-right  #user-form input#submit { float:right; }
.nm-wrapper { clear:both; font-size:14px; line-height:21px; margin:20px  0; padding:0px; }
.nm-wrapper div { background-position:99% 10px;  background-repeat:no-repeat; margin:0; padding:0; }
.nm-wrapper div div { }
.nm-wrapper div div div { overflow:hidden; }
#ninjamonials .nm-wrapper div div div div { background:transparent;  padding:20px;}
#ninjamonials .nm-wrapper div div div div div { padding:0; }
blockquote.nm-summary div, blockquote.nm-testimonial div,  blockquote.nm-summary, blockquote.nm-testimonial, blockquote.nm-summary  p, blockquote.nm-testimonial p { background:transparent; border:none;  padding:0; margin:0; text-decoration:none; font-style:normal; }
span.nm-button, #user-form input#submit { margin:5px; }
#user-form { background-position:left bottom;  background-repeat:repeat-x; clear:both; font-size:14px;  line-height:21px; margin-top:20px; padding:5px; }
.nm-testimonial, .nm-summary, .nm-author { padding-left:140px }
.nm-summary { font-weight:bold; }
.nm-author { display:block; font-size:12px; }
.nm-name { font-weight:bold; padding-right:5px; }
.nm-video, div.nm-video-reverse { margin:10px !important; }
.nm-audio, .nm-author { padding:5px !important; }
.nm-audio { display:block; }
.nm-name { font-style:italic; }
/* Oceanic Avatar-Specific CSS */
.nm-avatar { }
.nm-avatar img { background-color:#F7F7F7; border:1px solid #DBDBDB;  margin:10px; padding:5px; }
/* Oceanic Module-Specific CSS */
.nm-module { overflow:hidden; margin: 5px; padding:4px!important; }
.nm-module div.nm-avatar img { }
.nm-module div.nm-avatar { }
/* Blue Style */
.nm-right.nm-oceanic-blue.nm-module, .nm-right.nm-oceanic-blue  .nm-module { background:#EFF8FF url(oceanic_blue_tl.png) no-repeat -10px  -10px; border:1px solid #D5ECFF; -moz-border-radius:5px;  -webkit-border-radius:5px; }
.nm-left.nm-oceanic-blue.nm-module, .nm-left.nm-oceanic-blue .nm-module {  background:#EFF8FF url(oceanic_blue_nq.png) no-repeat -10px -10px;  border:1px solid #D5ECFF; -moz-border-radius:5px;  -webkit-border-radius:5px; }
.nm-right.nm-oceanic-blue .nm-wrapper { background:#EFF8FF  url(oceanic_blue_tl.png) no-repeat; color:#666; }
.nm-left.nm-oceanic-blue .nm-wrapper { background:#EFF8FF  url(oceanic_blue_nq.png) no-repeat; color:#666; }
.nm-oceanic-blue .nm-wrapper div { background:url(oceanic_blue_tr.png)  no-repeat 100% 0; }
.nm-oceanic-blue .nm-wrapper div div {  background:url(oceanic_blue_bl.png) no-repeat 0 100%; }
.nm-oceanic-blue .nm-wrapper div div div {  background:url(oceanic_blue_br.png) no-repeat 100% 100%; }
.nm-oceanic-blue #user-form { background-color:#EFF8FF; border:1px solid  #D5ECFF; -moz-border-radius:5px; -webkit-border-radius:5px; }
.nm-left.nm-oceanic-blue .nm-avatar-wrapper { margin:0 10px 10px 0;  min-height:70px; min-width:90px; background: url(oceanic_blue_quote.png)  no-repeat 10px 10px !important; }
/* Green Style */
.nm-right.nm-oceanic-green.nm-module, .nm-right.nm-oceanic-green  .nm-module { background:#EBF4D7 url(oceanic_green_tl.png) no-repeat  -10px -10px; border:1px solid #9AC740; -moz-border-radius:5px;  -webkit-border-radius:5px; }
.nm-left.nm-oceanic-green.nm-module, .nm-left.nm-oceanic-green  .nm-module { background:#EBF4D7 url(oceanic_green_nq.png) no-repeat  -10px -10px; border:1px solid #9AC740; -moz-border-radius:5px;  -webkit-border-radius:5px; }
.nm-right.nm-oceanic-green .nm-wrapper { background:#EBF4D7  url(oceanic_green_tl.png) no-repeat; color:#666; }
.nm-left.nm-oceanic-green .nm-wrapper { background:#EBF4D7  url(oceanic_green_nq.png) no-repeat; color:#666; }
.nm-oceanic-green .nm-wrapper div { background:url(oceanic_green_tr.png)  no-repeat 100% 0; }
.nm-oceanic-green .nm-wrapper div div {  background:url(oceanic_green_bl.png) no-repeat 0 100%; }
.nm-oceanic-green .nm-wrapper div div div {  background:url(oceanic_green_br.png) no-repeat 100% 100%; }
.nm-oceanic-green #user-form { background-color:#EBF4D7; border:1px  solid #9AC740; -moz-border-radius:5px; -webkit-border-radius:5px; }
.nm-left.nm-oceanic-green .nm-avatar-wrapper { margin:0 10px 10px 0;  min-height:70px; min-width:90px; background:  url(oceanic_green_quote.png) no-repeat 10px 10px !important; }
/* Grey Style */
.nm-right.nm-oceanic-grey.nm-module, .nm-right.nm-oceanic-grey  .nm-module { background:#EFEFEF url(oceanic_grey_tl.png) no-repeat -10px  -10px; border:1px solid #999; -moz-border-radius:5px;  -webkit-border-radius:5px; }
.nm-left.nm-oceanic-grey.nm-module, .nm-left.nm-oceanic-grey .nm-module {  background:#EFEFEF url(oceanic_grey_nq.png) no-repeat -10px -10px;  border:1px solid #999; -moz-border-radius:5px;  -webkit-border-radius:5px; }
.nm-right.nm-oceanic-grey .nm-wrapper { background:#EFEFEF  url(oceanic_grey_tl.png) no-repeat; color:#666; }
.nm-left.nm-oceanic-grey .nm-wrapper { background:#EFEFEF  url(oceanic_grey_nq.png) no-repeat; color:#666; }
.nm-oceanic-grey .nm-wrapper div { background:url(oceanic_grey_tr.png)  no-repeat 100% 0; }
.nm-oceanic-grey .nm-wrapper div div {  background:url(oceanic_grey_bl.png) no-repeat 0 100%; }
.nm-oceanic-grey .nm-wrapper div div div {  background:url(./images/oceanic_grey_br.png) no-repeat 100% 100%; }
.nm-oceanic-grey #user-form { background-color:#EFEFEF; border:1px solid  #999; -moz-border-radius:5px; -webkit-border-radius:5px; }
.nm-left.nm-oceanic-grey .nm-avatar-wrapper { margin:0 10px 10px 0;  min-height:70px; min-width:90px; background:  url(./images/oceanic_grey_quote.png) no-repeat 10px 10px !important; }
/* White Style */
.nm-right.nm-oceanic-white.nm-module, .nm-right.nm-oceanic-white  .nm-module { background:#FFF url(oceanic_white_tl.png) no-repeat -10px  -10px; border:1px solid #E8E8E8; -moz-border-radius:5px;  -webkit-border-radius:5px; }
.nm-left.nm-oceanic-white.nm-module, .nm-left.nm-oceanic-white  .nm-module { background:#FFF url(oceanic_white_nq.png) no-repeat -10px  -10px; border:1px solid #E8E8E8; -moz-border-radius:5px;  -webkit-border-radius:5px; }
.nm-right.nm-oceanic-white .nm-wrapper { background:#FFF  url(oceanic_white_tl.png) no-repeat; color:#666; border:1px solid  #E8E8E8; -moz-border-radius:5px; -webkit-border-radius:5px; }
.nm-left.nm-oceanic-white .nm-wrapper { background:#FFF  url(oceanic_white_nq.png) no-repeat; color:#666; border:1px solid  #E8E8E8; -moz-border-radius:5px; -webkit-border-radius:5px; }
.nm-oceanic-white .nm-wrapper div { background:url(oceanic_white_tr.png)  no-repeat 100% 0; }
.nm-oceanic-white .nm-wrapper div div {  background:url(oceanic_white_bl.png) no-repeat 0 100%; }
.nm-oceanic-white .nm-wrapper div div div {  background:url(oceanic_white_br.png) no-repeat 100% 100%; }
.nm-oceanic-white #user-form { background-color:#FFF; border:1px solid  #E8E8E8; -moz-border-radius:5px; -webkit-border-radius:5px; }
.nm-left.nm-oceanic-white .nm-avatar-wrapper { margin:0 10px 10px 0;  min-height:70px; min-width:90px; background:  url(oceanic_white_quote.png) no-repeat 10px 10px !important; }
.nm-audio1 {padding:5px !important; }
.nm-summary1 {padding-left:140px }
</style>                                   
<div id="ninjamonials" class="nm-oceanic-grey nm-left"  style="width:80%">
          <!--bof nm-wrapper -->
  <div class="nm-wrapper">
    <div>
      <div>
        <div>
                              <div class="nm-content">
            <div class="nm-avatar-wrapper">
                          </div>
                                                <blockquote 
class="nm-testimonial">
              <p>This is a testimonial test. This is a testimonial  test.   This is a testimonial test. This is a testimonial test. This is  a   testimonial test. This is a testimonial test. </p>
              <p>This is a testimonial test. This is a testimonial  test. This is a   testimonial test. This is a testimonial test. This is  a testimonial   test. This is a testimonial test. </p>
                                </blockquote>
                                    <div class="nm-author">
                            <span  class="nm-name">Name</span>
               (Website<span class="nm-title"></span>
               ~               <span class="nm-auth-url"><a 
href="http://www.google.com/">www.google.com</a></span>
              ,               <span  class="nm-location">Mine</span>
               )                           </div>
            <!--eof nm-author --> 
          </div>
          <!--eof nm-content -->
                    <!--eof wrapper --> 
        </div>
      </div>
    </div>
  </div>
  <!--eof foreach -->
    <!--bof nm-wrapper -->
  <div class="nm-wrapper">
    <div>
      <div>
        <div>
                              <div class="nm-content">
            <div class="nm-avatar-wrapper">
                            <!--<div class="nm-avatar">
                <img src="./images/oceanic_grey_quote.png" alt=""  height="100">
              </div>  -->
                          </div>
                                                <blockquote 
class="nm-testimonial">
              <p>This is a testimonial test. This is a testimonial  test.   This is a testimonial test. This is a testimonial test. This is  a   testimonial test. This is a testimonial test. </p>
              <p>This is a testimonial test. This is a testimonial  test. This is a   testimonial test. This is a testimonial test. This is  a testimonial   test. This is a testimonial test. This is a testimonial  test. This is a testimonial test.   This is a testimonial test. This is  a testimonial test. This is a   testimonial test. This is a testimonial  test. </p>
              <p>This is a testimonial test. This is a testimonial  test. This is a   testimonial test. This is a testimonial test. This is  a testimonial   test. This is a testimonial test. This is a testimonial  test. This is a testimonial test.   This is a testimonial test. This is  a testimonial test. This is a   testimonial test. This is a testimonial  test. </p>
              <p>This is a testimonial test. This is a testimonial  test. This is a   testimonial test. This is a testimonial test. This is  a testimonial   test. This is a testimonial test. </p>
                                </blockquote>
                                    <div  class="nm-author"><span class="nm-name">Name</span>  (Website<span class="nm-title"></span> ~ <span  class="nm-auth-url"><a 
href="http://www.google.com/">www.google.com</a></span> ,  <span class="nm-location">Mine</span> ) </div>
            <!--eof nm-author --> 
          </div>
          <!--eof nm-content -->
                    <!--eof wrapper --> 
        </div>
      </div>
    </div>
  </div>
  <!--eof foreach -->
    <!--bof nm-wrapper -->
  <div class="nm-wrapper">
    <div>
      <div>
        <div>
                              <div class="nm-content">
            <div class="nm-avatar-wrapper">
                            <!--<div class="nm-avatar">
                <img name="Christopher Cody" 
src="index.php_files/20091202033758_face3.jpg" alt="" height="100">      
         </div> -->
                          </div>
                                                <blockquote 
class="nm-testimonial">
              <p>This is a testimonial test. This is a testimonial  test.   This is a testimonial test. This is a testimonial test. This is  a   testimonial test. This is a testimonial test. </p>
              <p>This is a testimonial test. This is a testimonial  test. This is a   testimonial test. This is a testimonial test. This is  a testimonial   test. This is a testimonial test. This is a testimonial  test. This is a testimonial test.   This is a testimonial test. This is  a testimonial test. This is a   testimonial test. This is a testimonial  test. </p>
              <p>This is a testimonial test. This is a testimonial  test. This is a   testimonial test. This is a testimonial test. This is  a testimonial   test. This is a testimonial test. </p>
                                </blockquote>
                                    <div  class="nm-author"><span class="nm-name">Name</span>  (Website<span class="nm-title"></span> ~ <span  class="nm-auth-url"><a 
href="http://www.google.com/">www.google.com</a></span> ,  <span class="nm-location">Mine</span> ) </div>
            <!--eof nm-author --> 
          </div>
          <!--eof nm-content -->
                    <!--eof wrapper --> 
        </div>
      </div>
    </div>
  </div>
  <!--eof foreach -->
    <!--bof nm-wrapper -->
  <div class="nm-wrapper">
    <div>
      <div>
        <div>
                              <div class="nm-content">
            <div class="nm-avatar-wrapper">
                           <!-- <div class="nm-avatar">
                <img name="Joe Donnely" 
src="index.php_files/20091202025022_face2.jpg" alt="" height="100">      
         </div> -->
                          </div>
                                                <blockquote 
class="nm-testimonial">
              <p>This is a testimonial test. This is a testimonial  test.   This is a testimonial test. This is a testimonial test. This is  a   testimonial test. This is a testimonial test. </p>
              <p>This is a testimonial test. This is a testimonial  test. This is a   testimonial test. This is a testimonial test. This is  a testimonial   test. This is a testimonial test. </p>
                                </blockquote>
                                    <div  class="nm-author"><span class="nm-name">Name</span>  (Website<span class="nm-title"></span> ~ <span  class="nm-auth-url"><a 
href="http://www.google.com/">www.google.com</a></span> ,  <span class="nm-location">Mine</span> ) </div>
            <!--eof nm-author --> 
          </div>
          <!--eof nm-content -->
                    <!--eof wrapper --> 
        </div>
      </div>
    </div>
  </div>
  <!--eof foreach -->
    <!--bof nm-wrapper -->
  <div class="nm-wrapper">
    <div>
      <div>
        <div>
                              <div class="nm-content">
            <div class="nm-avatar-wrapper">
                          </div>
                                                <blockquote 
class="nm-testimonial">
              <p>This is a testimonial test. This is a testimonial  test.   This is a testimonial test. This is a testimonial test. This is  a   testimonial test. This is a testimonial test. </p>
              <p>This is a testimonial test. This is a testimonial  test. This is a   testimonial test. This is a testimonial test. This is  a testimonial   test. This is a testimonial test. This is a testimonial  test. This is a testimonial test.   This is a testimonial test. This is  a testimonial test. This is a   testimonial test. This is a testimonial  test. </p>
              <p>This is a testimonial test. This is a testimonial  test. This is a   testimonial test. This is a testimonial test. This is  a testimonial   test. This is a testimonial test. </p>
                                </blockquote>
                                    <div  class="nm-author"><span class="nm-name">Name</span>  (Website<span class="nm-title"></span> ~ <span  class="nm-auth-url"><a 
href="http://www.google.com/">www.google.com</a></span> ,  <span class="nm-location">Mine</span> ) </div>
            <!--eof nm-author --> 
          </div>
          <!--eof nm-content -->
                    <!--eof wrapper --> 
        </div>
      </div>
    </div>
  </div>
  <!--eof foreach -->
    <!--bof nm-wrapper -->
  <div class="nm-wrapper">
    <div>
      <div>
        <div>
                              <div class="nm-content">
            <div class="nm-avatar-wrapper">
                          </div>
                                                <blockquote 
class="nm-testimonial">
              <p>This is a testimonial test. This is a testimonial  test.
 This is a testimonial test. This is a testimonial test. This is a 
testimonial test. This is a testimonial test. </p>
<p>This is a testimonial test. This is a testimonial test. This is  a 
testimonial test. This is a testimonial test. This is a testimonial 
test. This is a testimonial test. <br>
</p>
            </blockquote>
                                    <div  class="nm-author"><span class="nm-name">Name</span>  (Website<span class="nm-title"></span> ~ <span  class="nm-auth-url"><a 
href="http://www.google.com/">www.google.com</a></span> ,  <span class="nm-location">Mine</span> )  </div></div></div></div></div></div></div>
Waiting for your solution.
Thanks in advance!
eyashwant is offline
View Public Profile
 
 
Register now for full access!
Old 06-24-2010, 05:28 PM Re: How to Align a DIV Tag to Center
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
This topic has already been covered extensively in THIS STICKY.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
View Public Profile Visit wayfarer07's homepage!
 
Closed Thread     « Reply to How to Align a DIV Tag to Center
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33280 seconds with 12 queries