h1 отмечают класс (альтернатива)

Попробуйте win32clipboard от win32all пакета (это, вероятно, установлено, если Вы находитесь на ActiveState Python).

Посмотрите образец здесь: http://code.activestate.com/recipes/474121/

6
задан Kick Buttowski 9 August 2017 в 16:19
поделиться

6 ответов

Sure you can:

<h1 class="someclass">…</h1>

The class attribute is a in the attribute group coreattrs of core attributes that can be used with the h1 element.

12
ответ дан 8 December 2019 в 02:21
поделиться

You can style a header like this:

h1 { color: red; }

Or like this:

<h1 class="fancy">Fancy</h1>

.fancy { font-family: fantasy; }

If it's not working:

  • Check you don't have an old stylesheet cached (ctrl-F5 to reload)
  • Check you don't have any rules overriding your class (inspecting with Firebug or similar is very helpful here).
  • Check for typos in the HTML and CSS

Edit:

It sounds like you had h1 .myClass instead of h1.myClass - there's an important distinction:

h1 .myClass { } /* any element with class="myClass" within an <h1> */
h1.myClass  { } /* any <h1> with class="myClass" */
18
ответ дан 8 December 2019 в 02:21
поделиться

It sounds like you are using h1 for all titles on the page. Typically you would have a single h1 tag on the page for what the page contains (with text at least partly matching the title of the page), and lesser header tags for headlines of different parts of the content. That way you give most information to the search engines about what's important on the page. There are of course pages that doesn't fit into this model, but many do.

There are many different ways that you can specify a style for headers. For example:

For all h1 tags:

h1 { font-weight: bold; }

For all h1 and h2 tags:

h1, h2 { margin: 10px; }

For all h1 tags inside an element with id="main":

#main h1 { background: #ccc; }

For all h2 tags with class="Info":

h2.Info { color: #000; }

For all h3 tags inside an element with class="More":

.More h3 { text-decoration: underline; }
6
ответ дан 8 December 2019 в 02:21
поделиться

You can add a class to an

tag. Like this:

<h1 class="myclass"> ... </h1>

You can easily style it like this:

<style type="text/css">
.myclass { color : green }
</style>

3
ответ дан 8 December 2019 в 02:21
поделиться

The < title > tag is in your < head > section, so it wouldn't really make sense to add a class to it.

You can add a class to your < h1 > tag, though.

<h1 class="title">
0
ответ дан 8 December 2019 в 02:21
поделиться

The following should work:

<html>
<head>
<style type="text/css">
h1.custom {
    color: red;
    font-size: 16px;
}
</style>
</head>
<body>

<h1 class="custom"> test </h1>
</body>
</html>
0
ответ дан 8 December 2019 в 02:21
поделиться
Другие вопросы по тегам:

Похожие вопросы: