Home > Software engineering >  Buton Css not working html color and padding is not working
Buton Css not working html color and padding is not working

Time:06-20

My button is not displaying any css and I am clueless why they are not. For reference, here is the html code:

p.B3 {
    padding: 50px; border:1px solid black; background-color: yellow; border-radius: 50% font-family: cooper black; font-size: 50px
}
<!DOCTYPE html>
<html>
<head>
<title>WebDocTitle</title>
<link type="text/css" rel="stylesheet" href="css/stylesheet1.css"/>
</head>
<p align=center> <button type="button" onclick="window.location.href='#28.HTML';" >ButtonText1</button>
<p align=center> <button type="button" onclick="window.location.href='#29.HTML';" >ButtonText2</button>
</html>

CodePudding user response:

Dude, it's working fine there is no issue in your code just add space after p tag in CSS.

p .B3 {
    padding: 50px; border:1px solid black; background-color: yellow; border-radius: 50% font-family: cooper black; font-size: 50px
}
<!DOCTYPE html>
<html>
<head>
<title>WebDocTitle</title>
<link type="text/css" rel="stylesheet" href="css/stylesheet1.css"/>
</head>
<p align=center> <button type="button" onclick="window.location.href='#28.HTML';" >ButtonText1</button>
<p align=center> <button type="button" onclick="window.location.href='#29.HTML';" >ButtonText2</button>
</html>

CodePudding user response:

.B3 {
    padding: 50px; border:1px solid black; background-color: yellow; border-radius: 50% font-family: cooper black; font-size: 50px
}
<p align=center> <button type="button" onclick="window.location.href='#28.HTML';" >ButtonText1</button>
<p align=center> <button type="button" onclick="window.location.href='#29.HTML';" >ButtonText2</button>

CodePudding user response:

Man just put a space b/w p .B3 (NB: You don't even need p can just use

.B3 {
    padding: 50px; border:1px solid black; background-color: yellow; border-radius: 50% font-family: cooper black; font-size: 50px
}

)

AFTER :-

p .B3 {
    padding: 50px; border:1px solid black; background-color: yellow; border-radius: 50% font-family: cooper black; font-size: 50px
}
<!DOCTYPE html>
<html>
<head>
<title>WebDocTitle</title>
<link type="text/css" rel="stylesheet" href="css/stylesheet1.css"/>
</head>
<p align=center> <button type="button" onclick="window.location.href='#28.HTML';" >ButtonText1</button>
<p align=center> <button type="button" onclick="window.location.href='#29.HTML';" >ButtonText2</button>
</html>

CodePudding user response:

button.B3 {
    padding: 50px; border:1px solid black; background-color: yellow; border-radius: 50% font-family: cooper black; font-size: 50px
}
<!DOCTYPE html>
<html>
<head>
<title>WebDocTitle</title>
<link type="text/css" rel="stylesheet" href="css/stylesheet1.css"/>
</head>
<p align=center> <button type="button" onclick="window.location.href='#28.HTML';" >ButtonText1</button>
<p align=center> <button type="button" onclick="window.location.href='#29.HTML';" >ButtonText2</button>
</html>

CodePudding user response:

Do you have the complete source? It looks like you are missing some javascript.

  • Related