2016-08-04 2 views
0

Вот изображение моего вопроса:кнопки Anchor нужна наценка по бокам

enter image description here

Если вы посмотрите мои кнопки выровнены к там соответствующим сторонам. Мне нужно немного маргинга на левой и правой сторонах, чтобы они не были выровнены по всем сторонам. я попытался добавить маржу налево и маржинальный-вправо и он не сделал ничего

Вот мой CSS:

.profileinfo { 
     position: relative; 
     background-color: #202020; 
     box-sizing: border-box; 
     padding: 20px 20px 25px 20px; 
     -webkit-overflow-scrolling: touch; 
} 

.profileinfo a { 
     position: absolute; 
     right: 30px; 
     top: 34px; 
     display: block; 
     width: 260px; 
     box-sizing: border-box; 
     padding: 18px 0 16px 0; 
     font: 25px/25px '-apple-system',BlinkMacSystemFont,'HelveticaNeue',Roboto; 
     text-decoration: none; 
     text-align: center; 
     text-transform: uppercase; 
     color: #ffffff; 
     background-color: #13cc3a; 
     border: 0; 
     border-radius: 5px; 
     margin: 10px auto; 
     overflow: hidden; 
} 

a.genericbuttonright { 
     right: 0; 
     margin: 0; 
     width: 360px;  
} 

a.genericbuttonleft { 
     left: 0; 
     margin: 0; 
     width: 360px;     
} 

Вот мой HTML:

<div class="profileinfo"> 
<h1></h1> 
<br> 
<a class="genericbuttonleft" data-ripple-color="#ffffff" onclick="animateripple(event,this)" href="/profile/search">Search Profiles</a> 
<a class="genericbuttonright" data-ripple-color="#ffffff" onclick="animateripple(event,this)" href="/profile/create">Create a Profile</a><br><br> 
</div> 

ответ

0

Просто измените влево/вправо значения.

Codepen Demo

a.genericbuttonright { 
     right: 10px; /* here */ 
     margin: 0; 
     width: 360px;  
} 

a.genericbuttonleft { 
     left: 10px; /* here */ 
     margin: 0; 
     width: 360px;     
} 
Смежные вопросы