vendredi 1 octobre 2021

Align image to the right but not move the entire section

I have a code here that has an image as the background of the h1 header section using CSS. What I want it to do is to put the image on the right. What I have tried is to use the float: right to try to align the image to the right of the header but instead, it moves the entire h1 to the right which I do not want to do. Is there a way to just move the image without moving the entire thing?

My code is here

h1{
    background-color: #002171;
    color: #FFFFFF;
    font-family:Georgia, 'Times New Roman', Times, serif;
    background-image: url(sunset.jpg);
    height: 72px;
    background-repeat: no-repeat;
    text-align: center;
    padding-bottom: .5em;
}



Aucun commentaire:

Enregistrer un commentaire