登录 | 注册 | FAQ
Anonymous

Links

+ 发表回复

3 篇帖子 分页: 1 / 1


Links

jon267 » 周三 1月 12, 2011 11:33 am

Hi. I have just decided to have a go at building my own website and I have come across one problem that I don't seem to be able to find a solution to.

Its a basic design with a picture header, navbar on the left and content right.

My problem is in the content section. I want the links to turn to italics when the mouse is hovering over them.

Here's a section of my .css file:

div.content
{
min-height:615px;
margin-left:190px;
padding:1em;
}

div.footer
{
margin-top:9px;
padding:4px;
color:white;
background-color:a9bdd3;
clear:left;
}

div.navbar
{
float:left;
font-weight:bold;
text-transform:uppercase;
margin:0;
padding:0;
background-color:#7a8292;
}

div.button a
{
width:120px;
display:block;
color:#000000;
text-align:center;
padding:12px;
text-decoration:none;
}

div.button a:hover
{
width:120px;
display:block;
color:#000000;
text-align:center;
padding:12px;
text-decoration:none;
background-color:#a7b9d0;
}

So to make the links in the content section turn to italics I add:

a:hover
{
font-style: italic;
}

to the end of the .css file, but this also makes the links in the navbar turn to italics also, which I don't want.

Is it possible to just have the content section links change and not the navbar also, and if so what do I need to do to accomplish this? Thanks in advance.
头像

jon267

  • 帖子: 4
  • 注册: 周三 1月 12, 2011 11:11 am

Re: Links

HTML.net » 周三 1月 12, 2011 1:18 pm

div.content a:hover
{
font-style: italic;
}

That should do the trick :)

- Andreas, HTML.net
头像

HTML.net
Site Admin

  • 帖子: 1194
  • 注册: 周六 9月 11, 2010 11:24 am
--
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.

Re: Links

jon267 » 周三 1月 12, 2011 1:57 pm

Brilliant. Thanks for the reply. I am enjoying my html/css learning curve:)
头像

jon267

  • 帖子: 4
  • 注册: 周三 1月 12, 2011 11:11 am


+ 发表回复

分页: 1 / 1