Why is an HTML section element not altered by CSS? [closed] - html

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I have an HTML section that I am trying to alter with CSS:
<section class="jumbo">
<div class="container">
<h1>THIS IS THE TEXT CONTAINED WITHIN THE JUMBO</h1>
</div>
</section>
However the changes I make in my CSS file, such as changing the color of the text contained in the element are not having any affect:
#jumbo {
background-image: url("../images/carbon.jpeg");
background-position: center center;
min-height: 200px;
text-align: center;
}
#jumbo h1 {
color: white;
font-size: 45px;
padding-top: 15px;
line-height: 1.6em;
}
Do you have any tips for how I can debug an issue like this?

You have to use .jumbo.
More about CSS selectors: https://www.w3schools.com/cssref/css_selectors.asp

#jumbo is an id selector
you should use a class selector
.jumbo and .jumbo h1

Related

How to target the whole body except for some classes ? :not no work ? Angular [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I want to target everything in the body except 2 classes
body {
background: gray;
}
What I am try:
body:not(.myCustomClassWhereIsBackgroundWhite) {
background: white;
}
My angular component Profile:
<div class="myCustomClassWhereIsBackgroundWhite">
...other context
</div>
In this component is not affected background: white;
This is no work ?
Please provide me some solution ?
I want to some class to change and not be background gray
body:not(.myCustomClassWhereIsBackgroundWhite) targets body elements which donot have class myCustomClassWhereIsBackgroundWhite.
Reference
If you want to look elements inside body, you have to add a space like.
body :not(.myCustomClassWhereIsBackgroundWhite)
body {
background: gray;
}
body :not(.myCustomClassWhereIsBackgroundWhite) {
background: white;
}
<div class="myCustomClassWhereIsBackgroundWhite">
...other context
</div>
<div>
Some other element
</div>

CANNOT change anythings in css [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
Why can I not change the color, size or anything by using the project class or project id?? I can only can change something through These CLASS??
.These {
display: flex;
flex-direction: column;
height: 90vh;
align-items: center;
width: 100%;
}
#project {
color: yellow;
font-size: 3rem;
}
<div class="These">
<p clsss="project" id="project">
These are some of my projects
</p>
</div>
Check and make sure your CSS style sheet is properly linked to your HTML.
Your code works for me in codepen.There is a typo, however the ID should still pull it so I would check for a linking issue or post your
There is a typo in your paragraph element. Change clsss to class.
You have missspelled class. You have use clsss instead of class.
Snippet:
<div class="These">
<p class="project" id="project">
These are some of my projects
</p>
</div>

why background-image don't work in div (in bootstrap theme) [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
why background-image Don't work in div with class .milad
(i use bootstrap 4.3)
.milad {
width: 120px;
background-image: image-url('Untitled.png');
margin-top: 80px;
margin-left: 140px;
height: 120px;
}
<div class="milad"> </div>
your CSS property is wrong it should be url
example:
.milad {
width: 200px;
/*put path of your image file in the url */
/*background-image: url('Untitled.png'); */
background-image: url('https://placeimg.com/640/480/nature/grayscale');
margin-top: 80px;
margin-left: 140px;
height: 200px;
}
<div class="milad"> </div>

Div hover not working? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I have a div that refuses to change background colors when I hover over it. It stays the same. Here's the code.
HTML:
<div id="login"></div>
CSS:
#login {
position: fixed;
float: left;
background-color: none;
margin-left: 1.5%;
top: 1em;
height: 1.25em;
width: 7em;
text-align: center;
border-radius: .3em;
opacity: .5;
padding-top: 1em;
border: .18em solid gray;
}
#login:hover {
background-color: gray;
}
I had a similar problem. What I suggest is making sure there are no invisible objects over the div. This tells the program that your cursor is hovering the invisible object rather than the div with the hover element.
Works fine for me - http://jsfiddle.net/Q8A6d/
Which browser are you using? You cannot apply a
:hover
pseudo class to any elements other than <a> in older versions of IE (6 and below).
Your code appears to work properly here, so a few things could be wrong:
You might have linked your stylesheet to your HTML file improperly.
Some other CSS in the context of your project may be overriding the piece that you've given here.
You might be running into browser compatibility issues with the :hover selector or something else in your code that is breaking the styling.

Why is this :hover selector not working? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I can't figure out what I am doing wrong here! probably something really obvious. I am trying to change the background colour and font colour of a div on mouse hover using purely CSS/HTML
HTML:
<div id="cta">
Learn More >
</div>
CSS:
#cta {
width: 65px;
border: 1px solid #183073;
border-radius: 5px;
background-color: white;
color: #183073;
font-family: Arial;
font-size: 10px;
padding: 5px;
}
#cta:hover {
background-color: #183073;
color: white;
}
Thanks in advance!
Try to set the z-index of #cta to something large like 99999. If it works like that it means that you have another element covering your div and preventing the hover.
:hover will work for element of type A across Browsers.
Some browsers do not allow :hover to any DOM object and restricted only to Anchor.
Similar isssue is solved in
Hover effects not working with IE8