Results 1 to 2 of 2

Thread: how can i centere block eliminate using css1?

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2019
    Posts
    35

    how can i centere block eliminate using css1?

    how can i centere block eliminate using css1?
    < advertising removed by moderator >

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,677

    Re: how can i centere block eliminate using css1?

    To center a block element using CSS1, you will need to follow the CSS, Level 1 - Horizontal Formatting of Block Elements guideline. Specifically:
    Otherwise, if both 'margin-left' and 'margin-right' are 'auto', they will be set to equal values. This will center the element inside its parent.
    Here is an example:
    HTML Code:
    <div></div>
    Code:
    div {
      border: 1px solid black;
      height: 250px;
      margin-left: auto;
      margin-right: auto;
      width: 250px;
    }
    Fiddle: Live Demo

Posting Permissions

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



Click Here to Expand Forum to Full Width