2014-01-19 13 views
0

Мои извинения Возможно, я просто не использовал правильную терминологию в своих поисках, так как я уверен, что на это ответили пару тысяч раз.Адаптивное позиционирование элементов

Так что я много знаю о CSS и HTML, но не настолько, насколько хотелось бы. Большинство из того, что я знаю, предназначено для фиксированных (не реагирующих) веб-сайтов. Хотя я знаю немного отзывчивый как% вместо px, я столкнулся с проблемой при изменении размера моего браузера, чтобы имитировать 3 экрана (мобильный планшетный ноутбук/рабочий стол).

У меня есть 2 элемента бок о бок. Все хорошо на рабочем столе. Ну, когда я сжимаюсь до Tablet и Mobile, элемент (имя исполнителя и социальные ссылки) перекрывает изображение художника слева. Так же как меню исчезает (хотелось бы, чтобы информация об этом тоже, если вы не возражаете (Rebel Mouse Social также исчезает в мобильном размере)).

Как мне закодировать, чтобы имя исполнителя и элементы социальной ссылки перемещались под изображением вместо перекрытия?

В конечном итоге я хотел бы работать исключительно в DreamWeaver и покончить с Joomla, потому что через 3 года он начинает чувствовать себя довольно ограничительным.

Заранее благодарю вас за это, я действительно ценю, что вы (кто-то) нашли время, чтобы прочитать все это.

Рабочая Демонстрационный здесь http://www.blackandyellowrecords.com/mca/jlegacy

CSS (containted в статье Joomla с HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"          

    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<style type="text/css"> 
<!-- 
body { 
    font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif; 
    background-color: #D6D6D6; 
    margin: 0; 
    padding: 0; 
    color: #000; 
} 
/* ~~ Element/tag selectors ~~ */ 
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */ 
    padding: 0; 
    margin: 0; 
} 
h1, h2, h3, h4, h5, h6, p { 
    margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */ 
    padding-right: 15px; 
    padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */ 
    font-family: Ash; 
     color: 000; 
} 
a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */ 
    border: none; 
} 
/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */ 
a:link { 
    color:#414958; 
    text-decoration: none; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */ 
} 
a:visited { 
    color: #4E5869; 
    text-decoration: none; 
} 
a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */ 
    text-decoration: none; 
} 
/* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */ 
.artcontainer { 
     background-image: url('/images/icons/jlegheaderfade.png'); 
     background-repeat: no-repeat; 
     background-position: right top; 
    width: 100%; 
    background-color: #FFF; 
    margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */ 
} 
/* ~~ This is the layout information. ~~ 
1) Padding is only placed on the top and/or bottom of the div. The elements within this div have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design. 
*/ 
.artcontent { 
    padding: 0 0; 
} 
/* ~~ This grouped selector gives the lists in the .content area space ~~ */ 
.artcontent ul, .artcontent ol { 
    padding: 0 0px 0px 0px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */ 
} 
/* ~~ miscellaneous float/clear classes ~~ */ 
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */ 
    float: right; 
    margin-left: 8px; 
} 
.fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */ 
    float: left; 
    margin-right: 8px; 
} 
.clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the overflow:hidden on the .container is removed */ 
    clear:both; 
    height:0; 
    font-size: 1px; 
    line-height: 0px; 
} 

.artcontainer #artistpic{ 
     position: absolute; 
    top:0; 
    left:0; 
    float: left; 
     width: 90%; 
     height: auto; 
     z-index: 5; 
} 

.artistname{ 
    position:absolute; 
    text-align: center; 
    max-width: 400px; 
    line-height: .9; 
    float: left; 
    left: 65%; 
    top: 12%; 
} 
/*SOCIAL FEED*/ 
.rebel{ 
    float:none; 
    z-index:1; 
} 
/*SOCIAL ICONS*/ 
.sicons{ 
    position:absolute; 
    float: left; 
    left: 68%; 
    top: 14%; 
    font-size:10px; 
} 
/*SOCIAL ICON BLUR*/ 
.sicons img { 
    -webkit-transition: all 1s ease; 
    -moz-transition: all 1s ease; 
     -o-transition: all 1s ease; 
     -ms-transition: all 1s ease; 
      transition: all 1s ease; 
} 
/*HOVER BLUR*/ 
.sicons img:hover { 
    -webkit-filter: blur(5px); 
} 

.artistmenu{ 
    float:none; 
    position:absolute; 
    z-index:2; 
    top: 525px; 
    width: 99.9%; 
} 

--> 
</style> 

<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> 
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script> 
</head> 

HTML:

<body> 
<div class="artcontainer"> 
    <div class="artcontent"> 
    <div class="artistpic"> 
     <p><img src="/images/artists/jleg.png" alt="Jlegacy" width="459px"/></p> 
    </div> 
    <div class="artistname"> 
    <h1><strong>JLegacy</strong></h1> 
    </div> 
    <div class="sicons"><a href="http://www.twitter.com/jlegacydatruth" target="_blank"><img src="/images/icons/twitter.png" width="30px" height="30px"/></a> 
     <a href="https://www.facebook.com/JLegacysFinest" target="_blank"><img src="/images/icons/fb.png" width="30px" height="30px"/></a> 
     <a href="http://instagram.com/jlegacysfinest" target="_blank"><img src="/images/icons/insta.png" width="30px" height="30px"/></a> 
    </div> 
    <div class="artistmenu"> 
    <ul id="MenuBar1" class="MenuBarHorizontal"> 
      <li><a class="MenuBarItemSubmenu" href="#">Social</a></li> 
      <li><a href="#"> Streaming Music</a></li> 
      <li><a class="MenuBarItemSubmenu" href="#">Releases</a> 
      <ul> 
       <li><a class="MenuBarItemSubmenu" href="#">Albums</a></li> 
       <li><a href="#">Mixtapes</a></li> 
       <li><a href="#">Singles</a></li> 
      </ul> 
      </li> 
      <li><a href="#">Mailing List</a></li> 
    </ul> 
    </div> 
    <div class="rebel"> 
     <center> 
     <script type="text/javascript" class="rebelmouse-embed-script" src="https://www.rebelmouse.com/static/js-build/embed/embed.js?site=JLegacysFinest&height=1500&flexible=0&scrollbar_theme=light-2"></script> 
     </center> 
     </div> 
     <script type="text/javascript"> 
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); 
</script> 
    <!-- end .content --></div> 
    <!-- end .container --></div> 
</body> 
</html> 
+0

wowowo, еще 2 пара, и это была публикация материалов TMH ... do ** google для медиа-запросов ** мат ...... !! :) – NoobEditor

+0

@NoobEditor LOL полюбил ваш комментарий –

+0

Lol Спасибо Мне нравится писать книги HAHA. – BDSmith

ответ

0

Элементы вы упоминаете позицию: абсолютная, поэтому, изменив верхнее и левое значения, вы можете по их под изображением

ex.

.artistname { 
    top: 92%; 
    left: 49%; 
} 

Это не совсем точка адаптивного дизайна, но он будет работать для вас .. Конечно, вы будете нуждаться в медиа-запросе для этого.

+0

WADR mate ... 'media query' - это все, что ему нужно .... то, что вы предложили, будет применяться в целом для всех измерений иначе !!! :) – NoobEditor

+0

вот почему я сказал «конечно» .. чувак: P – Naele

+1

Naele благодарит за ваш ответ. Я проверю это вместе с запросом на работу в Google, как сказал NoobEditor. Спасибо всем, извините за книгу: -p Просто хотел быть конкретным, а не неуважением к просить. – BDSmith

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