You are viewing our Forum Archives. To view or take place in current topics click here.
HTML and CSS Query
Posted:

HTML and CSS QueryPosted:

Sys
  • 2 Million
Status: Offline
Joined: Dec 30, 201311Year Member
Posts: 1,331
Reputation Power: 69
Status: Offline
Joined: Dec 30, 201311Year Member
Posts: 1,331
Reputation Power: 69
Hey guys,

I am currently creating a website and I am wanting my logo to be centered in the middle of the page with a top padding of around 10-20 px, basically at the top middle of the page, This is the idea I am going for
[ Register or Signin to view external links. ]


CSS Code:
IMG.navlogo{
    position: fixed;
    margin-left: auto;
    margin-right: auto;
    object-position: center;
}


Outcome:
[ Register or Signin to view external links. ]


Thanks -0lly
#2. Posted:
OrsonCopeland
  • Challenger
Status: Offline
Joined: Feb 15, 201212Year Member
Posts: 194
Reputation Power: 7
Status: Offline
Joined: Feb 15, 201212Year Member
Posts: 194
Reputation Power: 7
Create this class.


.center-block {

  display: block;
  margin-right: auto;
  margin-left: auto;

}
#3. Posted:
Cyimking
  • V5 Launch
Status: Offline
Joined: May 02, 201212Year Member
Posts: 1,129
Reputation Power: 34
Status: Offline
Joined: May 02, 201212Year Member
Posts: 1,129
Reputation Power: 34
You can also use positions or margins left / right. If you use positions, you have to use relative and use top / left to get it where you want.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.