How to Center This Element?

2 replies
  • WEB DESIGN
  • |
Code:
#ournewsletter{
	width:852px;
	height:71px;
	margin:0px 0px 58px 0px;
	padding:64px 0px 0px 76px;
	background:url(images/ournewsletterbg.jpg) no-repeat;

}

#ournewsletter h2{
	float:left;
	height:39px;
	color:#fefdfd;
	font-size:24px;
	padding:7px 0px 0px 45px;
	background:url(images/ournewsletterh2bg.jpg) no-repeat;
}

#ournewsletter p{
	float:left;
	color:#fefdfd;
	font-size:13px;
	padding:8px 0px 0px 30px;
}
How do I center this element? All help appreciated.
I've tried: float:center;

And i've tried adding it as an inline style. But I cannot get the newsletter to center on the page! All help with this much appreciated!
#center #element
  • Profile picture of the author ronc0011
    You could try this

    Code:
    margin-top:10px;
    margin-left:auto; 
    margin-right:auto;
    margin-bottom:20px;
    
    Or even

    Code:
    margin:0pxauto10pxauto;
    

    Using "auto" for the left and right margin will cause it to center.
    {{ DiscussionBoard.errors[5301226].message }}
  • Profile picture of the author AdamDowning
    Thanks, just changed

    Code:
    margin:auto;
    After reading your comment. Much appreciated!
    Signature

    I'll write you 30 x 500 word articles @ $120 - Inbox me?

    {{ DiscussionBoard.errors[5303285].message }}

Trending Topics