B
B
Bebronyukh Savory2020-05-04 14:58:06
css
Bebronyukh Savory, 2020-05-04 14:58:06

How to display two headings on one line?

There is a very simple code:

<!DOCTYPE html>
<html>
<head>
  <link href="styles.css" rel="stylesheet" type="text/css" / >
  <title>ScreenDneter</title>
  <header><div><!--<a href=""><img src="logo.png" width="98" ></a>!--><H2 class = "products">ПРОДУКТЫ</H2><H2 class = "products">ПРОДУКТЫ2</H2></div></header>
</head>
<body>

</body></html>

And CSS:
*{
  margin: 0;
    padding: 0;

}

html{
  background-color: rgb(20,20,20);
  width: 100%;

}

header{
  
  border: 1;

  border-bottom: 2px solid rgb(53,53,53);
}
.products{
  color: white;

}

.img{
  float: left;


}


Why does the text element wrap to a new line?

The question is very simple, but I can not find the answer to it ... kAXhb6p.png
How to move the second element to the line to the first ..

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Oleg, 2020-05-04
@PrytexY

Add forh2 display: inline;

N
n1ksON, 2020-05-04
@n1ksON

Because titles are automatically written on new lines.

X
xdevelx, 2020-05-04
@develx

1- Your header is displayed in , but it should be in body 2 - headings are block elements and they should be displayed one under the other <head>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question