CSS Überschrift: Position senken?

Hallo, ich versuche mich zurzeit an einer CSS-Challenge. Leider weiß ich nicht, wie ich die Position der Überschrift (Learning is not a privilege…) ändern kann. Sie steht viel zu weit oben. Mit height kann ich hier nicht arbeiten, weil das Einfluss auf die unteren Blöcke hat und sich dann alles nach unten senkt. Zurzeit sieht der Code für die Überschrift wie folgt aus:

#header p {margin-left: 400px; font-size: 40px; }

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
3 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
DatLicht
1 year ago

Open the page in Chrome and press F12, then the developer tools open. Probably any other element will occupy the place, and then you can easily find out what.

Apart from that, instead of margin-left, you should use 400px rather text-align: center to center the headline. Pixel-precise margins look good at a certain resolution, but do not work anymore if you use a different resolution (e.g. on a large monitor, TV or smartphone). If you want to work on margins, instead of px, you could take the unit rem, which takes into account the pixel density of the display device.

Maybe instead of a p you could also use a chip with display: inline block to reduce the whitespace.

In addition, a lot of whitespace is on the page. Maybe you should think about a background graphics so that your page doesn’t look like 1998.

DatLicht
1 year ago
Reply to  xxAnniexx

Now, with the developer tool, you can select the appropriate element under “elements” and “play” with the CSS directly. According to the code in the link, the “live an let learn” seems to be an H1, which is by default a block element with neat margin up and down. Here you should see with display: inline-block times if you cannot adjust the text running to a reasonable degree.