Jump to content

Как можно вынести текст в отдельный блок с отступом, чтобы шапка не наезжала?


codor
 Share

Recommended Posts

Привет!

Сайт www.presents.octawa.ru. Cейчас шапка наезжает на текст.
Как можно вынести текст в отдельный блок с отступом? Чтобы шапка не наезжала.

Только осваиваю html и css. Пожалуйста, подробнее.

Файлы index.html, style.css ниже.

style.css

@charset "utf-8";
/* CSS Document */
#header { position:absolute; top:0px; left:0px; min-width:700px;
max-width:1920px; 
width:100%;
height:400px;
background-image:url(/thumbnail_large.jpg);
background-repeat:no-repeat; 
background-size: 100%; }

index.html

  Reveal hidden contents

 

Edited by codor
Link to comment
Share on other sites

  On 6/9/2018 at 1:35 PM, AlexZaw said:

Уберите абсолютное позиционирование у #header и все встанет как надо.

Либо добавьте стили

#head{
  margin-top: 400px;
}

 

Expand  
 

 

Удалил position:absolute, но все равно шапка закрывает часть книги и текст сверху (текст видно частично только при уменьшении окна).

style.css

@charset "utf-8";
/* CSS Document */
#header { top:0px; left:0px; min-width:700px;
    max-width:1920px; 
    width:100%;
    height:400px;
    background-image:url(/thumbnail_large.jpg);
    background-repeat:no-repeat; 
    background-size: 100%; }

Edited by codor
Link to comment
Share on other sites

Вообще конечно странный код, странное решение. Зачем делать абсолютное позиционирование там где это абослютно не нужно, а потом искать способы борьбы с последствиями?

Ну да ладно, постепенно поймете в чем у вас тут ошибка.

Edited by AlexZaw
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy