Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS BACKground image and back- color

Saumyojit

Well-Known Coder
HTML:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="./style.css">
</head>

<body style="background-color:lightblue;">

</body>
</html>


CSS:
body
  {


background-image:url("pass.jpeg"),url("skin.jfif");

  


    background-repeat: no-repeat,no-repeat;

    /* any background image will start from the top left corner of the element targeted*/

  background-size: 100% 50%, 100% 100%;

  /* setting the width and height of both the images */
  }


will the inline css over ride external css or external css will over ride ?
but i know that inline css specificity is higher

Screenshot (232).png


Why the background image is showing?? (see at the top)
 
will the inline css over ride external css or external css will over ride ?
but i know that inline css specificity is higher
Inline CSS almost always overwrites stylesheet CSS.

Why the background image is showing?? (see at the top)
Because background-color and background-image do two different things and can both be applied at the same time. If you were to use:

CSS:
<body style="background:lightblue;">

You will not see the background image anymore.

-----

Also, please stop tagging me in your threads.
 
Inline CSS almost always overwrites stylesheet CSS.


Because background-color and background-image do two different things and can both be applied at the same time. If you were to use:

CSS:
<body style="background:lightblue;">

You will not see the background image anymore.

-----

Also, please stop tagging me in your threads.
no thats not happening .
bakc color and back image are both there . see the pic carefully.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom