Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Horizantal problem in CSS

Horizantal problem in CSS

Scheduled Pinned Locked Moved Web Development
helpquestioncss
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dipak dipak
    wrote on last edited by
    #1

    Hello everybody, I want to set a div in the vartical and horizantal center of an div. how can i set? There is a property for text-align and vartical-align but these are for text not for any element. please help me. Thank you. :-O

    Dipak

    A 1 Reply Last reply
    0
    • D dipak dipak

      Hello everybody, I want to set a div in the vartical and horizantal center of an div. how can i set? There is a property for text-align and vartical-align but these are for text not for any element. please help me. Thank you. :-O

      Dipak

      A Offline
      A Offline
      Aurelius1664
      wrote on last edited by
      #2

      For horizontal centering you need to set the style "text-align:center;" on the outer DIV and then "margin-left:auto;margin-right:auto;" on the inner DIV. This should work for all elements in Firefox as well as Internet Explorer.

      A 1 Reply Last reply
      0
      • A Aurelius1664

        For horizontal centering you need to set the style "text-align:center;" on the outer DIV and then "margin-left:auto;margin-right:auto;" on the inner DIV. This should work for all elements in Firefox as well as Internet Explorer.

        A Offline
        A Offline
        acodman
        wrote on last edited by
        #3

        You are right... You can also centralize as follow: margin: 0 auto; Cheers!

        modified on Monday, January 21, 2008 5:30:29 AM

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups