2016-03-14 2 views
3

Итак, я пытаюсь сделать изображение застрявшим в нижней части страницы с фиксированной позицией (вроде как панель навигации). Проблема в том, что у меня есть текст где-то в центре страницы, и когда я увеличиваю масштаб, это изображение покрывает часть текста, и его невозможно увидеть.Позиция: Исправлено Div Обложки изображений

CSS:

.bottom { 
    display: block; 
    position:fixed; 
    width:100%; 
    height: 70px; 
    bottom: 0px; 
} 

p.BrunchENG_TXT{ 
    padding-top: 20px; 
    text-align: justify; 
    margin: 0 auto; 
    width: 60%; 
    color:#7b0d4c; 
    font-family:"Verdana"; 
} 

HTML:

<div> 
<p class="BrunchENG_TXT"> 
    <b>Brunch</b> 
    </br> 
    The weekends are holydays, giving us the chance to share special moments with the people we love the most….We welcome everybody each Sunday starting 11 o’clock so that all of you can enjoy fully this precious time and recharge with healthy food and energy for the day….Welcome to the Sunday Bruch @ Mumbai Burgas - the menus are composed with special attention to the children and the vegetarians and are published well in advance on our FB page. 
</p> 

<div> 
    <img src="images/repetB.jpg" class="bottom"> 
</div> 
</div> 
+0

не могли бы вы указать ваш html? – reshad

+1

Вопросы поиска справки по отладке («почему этот код не работает?») Должны включать в себя желаемое поведение, конкретную проблему или ошибку и кратчайший код, необходимый для воспроизведения в самом вопросе. Вопросы без четкого описания проблемы не полезны другим читателям. См. [Как создать минимальный, завершенный и проверяемый пример] (http://stackoverflow.com/help/mcve). –

+0

Там, весь код, просто текст и изображение, ничего особенного, я хочу, чтобы фиксированное изображение не покрывало текст. –

ответ

0

Попробуйте этот код работает для меня

CSS:

.bottom { 
display: block; 
position:fixed; 
width:100%; 
height: 70px; 
bottom: 0px; 
} 

    p.BrunchENG_TXT{ 
    padding-top: 20px; 
    text-align: justify; 
    margin: 0 auto; 
    width: 60%; 
    color:#7b0d4c; 
    font-family:"Verdana"; 
    } 

    #img-footer{ 
    height: 100px; /* change 100px by height of the picture "repetB.jpg"*/ 
    } 

HTML:

<div> 
<p class="BrunchENG_TXT"> <b>Brunch</b> </br> 
The weekends are holydays, giving us the chance to share special moments with the people we love the most….We welcome everybody each Sunday starting 11 o’clock so that all of you can enjoy fully this precious time and recharge with healthy food and energy for the day….Welcome to the Sunday Bruch @ Mumbai Burgas - the menus are composed with special attention to the children and the vegetarians and are published well in advance on our FB page. 
</p> 

<div id="img-footer"> 
<img src="images/repetB.jpg" class="bottom"> 
</div> 
</div> 
1

Я использовал margin-bottom: 100px;, и это сработало!

+0

Работает ли он так хорошо, если вы изменяете размер своего окна? Также подумайте о больших/меньших экранах и мобильных телефонах :) –

+0

Он хорошо вписывается в мой код, и я пока не вижу проблем, так что да, это сработало для меня :) –

Смежные вопросы