Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

center div horizontally

/* margin auto does the magic, make sure to provide width less than 100% */
.center {
	margin: auto;
    width: 400px;
}

.center {
	margin: auto;
    width: 50%;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #center #div #horizontally
ADD COMMENT
Topic
Name
8+7 =