What is wrong with my code?


#1

i feel as if i have done everything right but it still is giving me an error:
Oops, try again. Did you remember to set your link's text-decoration to none;?

img {
display: block;
height: 100px;
width: 300px;
margin: auto;
}

p {
text-align: center;
font-family: Garamond, serif;
font-size: 18px;
}
/*Start adding your CSS below!*/
div {
height: 50px;
width: 120px;
border-color: #6495ED;
background color: #BCD2EE;
border-radius: 5px;
margin: auto;
text-align: center;
text-decoration: none;
}


#2

You have set the entire div's text-decoration to none instead of specifically the link. To specify the link only, you need to change div { to div a{.

Hope that works!


#3

Thnx could u pls tell me the reasoning for that.
Btw, how do u make specific characters stand out in CSS that are in different locations of the webpage?


#4

Sure.

When your CSS was div {......text-decoration: none;}, it was selecting the entire div, which is not what the lesson wants. What the lesson wants is for you to select the link which is in the div. In HTML , links made using anchor tags, like this: <a href="#">link text</a>, and so we select the tag, <a> , which is inside the divider, <div>, by doing div a {....}. By putting the 'a' after the 'div' we are saying that we want to select only the links which are inside the divider.

What do you mean by this? (Below)


#5

@jibblyj, so close. You should actually add a new css selector (a or div a), a few of the property's inside div, should stay to div, if you change div to div a you ruin your button


#6

tray this

def cube(number):
return number**3
def by_three(number):
if number % 3 == 0:
return cube(number)
else:
return False
number = int(raw_input("Enter number"))
print by_three(number)


#7

it looks like you have the wrong forum, this html + css. and too me, that looks like python code


#8

And that code is completely irrelevant to the topic...

But I was sooo close!


#9

i flagged it as off-topic, hope that helps. Yea, you where so close.


#10

yeah sorry this is javascript
i only just found out itn was the wrong forum STRAIGHT after i posted it
thnx for help though