The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

css problems with center code

Go down

Solved css problems with center code

Post by Novaen on April 1st 2012, 9:37 pm

Hi.

I've changed the navbar with a picture, and I've tried to center it with some center codes for css. But it doesn't work!

This is my code for the navbar pic:

#pun-head #pun-navlinks {
background-image:url('http://i44.tinypic.com/lguap.png'); }
#pun-head #pun-navlinks {
background-image:url('http://i44.tinypic.com/lguap.png');
background-repeat: no-repeat; }

#pun-head #pun-navlinks {
padding: 4.1em 1.5em 5.5em 1.1em;
background-color: transparent
border-color: #ffffff;
}

I don't know where to put the center codes, and if it does matter, but I've tried:

margin: 0 auto

and:

margin-left:auto;
margin-right:auto;

and then:

text-align: center

but none of them seems to work on my PunBB forum.

What to do??


Last edited by Novaen on April 2nd 2012, 11:31 pm; edited 3 times in total
avatar
Novaen
Forumember

Female Posts : 29
Reputation : 0
Language : Danish, English
Location : Denmark

http://avonue.danskforum.net/forum

Back to top Go down

Solved Re: css problems with center code

Post by LGforum on April 1st 2012, 10:12 pm

What is you need centered? Everything seems centered on your forum.

The codes go inside the selector that you want centered of course.
avatar
LGforum
Hyperactive

Male Posts : 2263
Reputation : 260
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: css problems with center code

Post by Novaen on April 1st 2012, 10:37 pm



it's the picture I want to center. This screen shot is taken when I've zoomed out in the browser, but the pic should center too.
avatar
Novaen
Forumember

Female Posts : 29
Reputation : 0
Language : Danish, English
Location : Denmark

http://avonue.danskforum.net/forum

Back to top Go down

Solved Re: css problems with center code

Post by Light Elf on April 2nd 2012, 1:24 am

You can try it manual by adding this code:
Code:
margin-left:Ypx; /*Y is a number*/
avatar
Light Elf
Forumember

Posts : 144
Reputation : 11
Language : English

Back to top Go down

Solved Re: css problems with center code

Post by LGforum on April 2nd 2012, 2:34 am

That image was centered when I visited your forum.
Make sure you set a width in percentage.

Code:

width: 98%;
margin: 1px auto;

Make sure that goes in the same selector.
avatar
LGforum
Hyperactive

Male Posts : 2263
Reputation : 260
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: css problems with center code

Post by Novaen on April 2nd 2012, 1:42 pm

doesn't seems to work.

LGforum - well, I only see it when I zoom out on my board. If I've it in the normal stage it's just looking fine. I saw the little problem when I visited a friend, and her computer is bigger than mine, so it wasn't centred there.
avatar
Novaen
Forumember

Female Posts : 29
Reputation : 0
Language : Danish, English
Location : Denmark

http://avonue.danskforum.net/forum

Back to top Go down

Solved Re: css problems with center code

Post by E-Mark on April 2nd 2012, 2:48 pm

Add this to your CSS Stylesheet:

Code:

#pun-navlinks ul {
   text-align: center;
   }

Wink
avatar
E-Mark
Active Poster

Male Posts : 1389
Reputation : 164
Language : English, Tagalog
Location : Republic of the Philippines

http://coding-spot.darkbb.com/

Back to top Go down

Solved Re: css problems with center code

Post by ankillien on April 2nd 2012, 4:00 pm

Hi,

I think its the background image that needs to be centered, you can use this CSS code...

Code:
#pun-head #pun-navlinks {
background-position: center;
}
avatar
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

http://www.webartzforum.com/

Back to top Go down

Solved Re: css problems with center code

Post by Novaen on April 2nd 2012, 11:30 pm

ankillien - thanks! that solved my problem! Smile

And thanks to your all for your good support!

/Nova
avatar
Novaen
Forumember

Female Posts : 29
Reputation : 0
Language : Danish, English
Location : Denmark

http://avonue.danskforum.net/forum

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum