Style сonflict

Report a typo

We have the simple HTML page:

get("/html") {
    call.respondHtml(HttpStatusCode.OK) {
        head {
            link(rel = "stylesheet", href = "/style.css")
        }
        body {
            h1("greetingClass") {
                attributes["id"] = "greetingId"
                +"Hello user!"
            }
        }
    }
}

This page has an element with the following attributes: class="greetingClass" and id="greetingId"

Styles:

get("/style.css") {
    call.respondCss {
        rule("#greetingId") {
            color = Color("#0000FF")
        }
        rule(".greetingClass") {
            color = Color("#00FF00")
        }
    }
}

What will the user see in the browser?

1)

green "Hello user!" text

2)

blue "Hello user!" text

3)

blue "Hello" and green "user!"  text

4)

green "Hello" and blue "user!"  text

5)

cyan "Hello user!" text

Open the IDE and check the result yourself.

Select one option from the list
___

Create a free account to access the full topic