Links inside links with CSS?
Moderator: General Moderators
- allspiritseve
- DevNet Resident
- Posts: 1174
- Joined: Thu Mar 06, 2008 8:23 am
- Location: Ann Arbor, MI (USA)
Links inside links with CSS?
I'm wondering if it's possible to create links inside links with CSS. I'm making an interface to navigate a hierarchy of content in a CMS, and each section has a list of content. If you click on the box containing the content, it will open a new listing with that content as the parent, and show all it's children (and so on as you navigate through the hierarchy). I'd also like to have links inside each box for editing, moving, or deleting each item... so far my attempts at doing this have failed, as styles applied to the parent a tag also apply to the a tags inside them. Any ideas?
Re: Links inside links with CSS?
In CSS, you could apply different styles like:
However, I'm pretty sure you're not allowed to have nested <a> tags. It looks like you might need Javascript for this.
Code: Select all
/* only apply to first level links */
.menu > a{
border:1px solid #333;
padding:3px;
}
.menu a a{
color:#fff;
font-size:0.75em;
}Real programmers don't comment their code. If it was hard to write, it should be hard to understand.