Subs of links...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Goofan
Forum Contributor
Posts: 305
Joined: Wed Nov 04, 2009 2:11 pm
Location: Sweden

Subs of links...

Post by Goofan »

Hi!

I need to make my sub of a link to be "margined" more from the edge.

To explain further here is an exampel:

This is how it looks right now:
Link 1
Link 'Sub 1
Link 'Sub 2
Link 2
Link 3

This is how id like it to be:
Link 1
_____Link 'Sub 1
_____Link 'Sub 2
Link 2
Link 3

This is like you go onto an pager and you press first link then u get sub links. i got these but i cant get them to stand out "have a margin". I thought of using Css to make an margin but I only ran into trubble as i dont know in what i should have the class object from css inputed at.

Exampel <p Class="Extra P">
=)

//Thanks in advance
//Thomas
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Subs of links...

Post by requinix »

What HTML do you use for that menu?
User avatar
hypedupdawg
Forum Commoner
Posts: 74
Joined: Sat Apr 10, 2010 5:21 am

Re: Subs of links...

Post by hypedupdawg »

By default, HTML has two list types built in: the <ul> and <li> tags. <ul> gives an indent without any numbering/bullets, but <li> does provide markers. So if you wanted to just provide an indent with no bullets, you could do something like:

Code: Select all

<body>
<p>
Links<br/><br/>
Link 1
<ul>Link 2<br/>
Link 3
	<ul>Link 4</ul>
</ul>
</p>
</body>
The <ul> elements then stack to allow multiple lists. This outputs an effect like this:

Code: Select all

Links 

Link 1
	Link 2
	Link 3
		Link 4
I presume you can then edit the effect of the <ul> tag in css - however, I will try it out first and then get back to you.
User avatar
Goofan
Forum Contributor
Posts: 305
Joined: Wed Nov 04, 2009 2:11 pm
Location: Sweden

Re: Subs of links...

Post by Goofan »

hypedupdawg That was exacly what i were searching for i didnt know that <ul> didnt give and numbering or so. Perfect =)

Ill do some css changes to it and that would be great thank you =)

//Thanks a bunch
//Thomas
User avatar
hypedupdawg
Forum Commoner
Posts: 74
Joined: Sat Apr 10, 2010 5:21 am

Re: Subs of links...

Post by hypedupdawg »

When you do find your perfect css, would you let me know? I'd be interested in seeing which attributes to change etc.
Post Reply