Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Estilo CSS personalizado para Native Ad en el artículo http://www.hermosaprogramacion.com/2016/08/admob-android/
/* Note: 1px = 1dp in this css */
/* == Colors == */
body {
background-color: #fff;
}
.title-link {
color: #000000;
}
.button {
background-color: #FF4081;
}
.button-text,
.button-link {
color: #ffffff;
font-weight:bold;
text-transform:uppercase;
}
.price,
.reviews {
color: rgba(0,0,0,0.5);
}
.reviews svg {
fill: rgba(0,0,0,0.7);
}
.url-link {
color: #0274BE;
}
.body {
color: rgba(0,0,0,0.7);
}
/* == Fonts == */
body {
font-family: "Roboto-Regular", Arial, sans-serif;
font-weight: normal;
font-size: 10px;
}
@media (min-width: 360px) and (min-height: 150px) {
body {
font-size: 12px;
}
}
@media (min-width: 700px) and (min-height: 150px) {
body {
font-size: 16px;
}
}
.title {
font-size: 1.3em;
line-height: 1.35em;
}
.button {
font-size: 1.3em;
}
.body,
.price,
.reviews,
.url {
font-size: 1.1em;
line-height: 1.15em;
}
@media (min-width: 360px) and (min-height: 150px) {
.title {
font-size: 1.3em;
line-height: 1.35em;
}
.button {
font-size: 1.3em;
}
}
/* == Layout == */
.app-icon,
.image {
float: left;
margin: 0 8px 4px 16px;
padding: 0;
}
.button {
display: block;
float: right;
margin: 0 16px 0 4px;
position: relative;
top: 0;
}
.title {
margin-bottom: 5px;
padding: 5px 0 0 0;
}
.body {
margin: 8px 16px 8px 16px;
}
@media (min-width: 360px) {
.body {
clear: left;
}
}
/**
* == App install ad layout ==
* App store, price, and reviews are
* optional elements.
*/
.app-store {
position: absolute;
right: 8px;
bottom: 12px;
}
.price,
.reviews {
display: inline-block;
margin: 2px 4px 0 0;
}
.rating-stars,
.reviews-count {
display: inline;
}
.reviews-count {
margin-left: 2px;
}
/* == Content ad layout == */
.url {
clear: right;
padding: 4px 0;
}
@media (min-width: 700px) and (min-height: 150px) {
.url {
clear: none;
}
}
/* == Body == */
.app-promo-ads .body {
/**
* max-width
* = total width - padding - app store
*/
max-width: 70%;
max-width: calc(100% - 80px);
}
@media (min-width: 700px) and (min-height: 150px) {
.app-promo-ads .body {
max-width: calc(100% - 140px);
}
}
/* == App icon, content image == */
.app-icon img,
.image img {
height: 70px;
width: 70px;
}
.app-icon img {
border-radius: 20%;
}
/* == Title == */
.title {
display: block;
text-align: left;
}
/* == Button == */
.button {
border: none;
border-radius: 2px;
box-shadow: 0 0 2px rgba(0,0,0,0.12), 0 2px 2px rgba(0,0,0,0.24);
}
.button-link {
display: block;
position: relative;
padding: 0 1em;
}
.button svg {
display: none;
}
.button {
height: 2.8em;
}
.button-text {
display: block;
line-height: 2.8em;
text-align: center;
min-width: 50px;
max-width: 78px;
text-align: center;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
@media (min-width: 360px) {
.button-link {
padding: 0 1.5em;
}
.button-text {
max-width: 100px;
}
}
@media (min-width: 700px) and (min-height: 150px) {
.button {
height: 2em;
}
.button-text {
line-height: 2em;
max-width: 180px;
}
}
/* == App store == */
.app-store {
border: none;
}
.app-store a {
display: inline-block;
height: 1.4em;
}
.app-store img {
height: 100%;
width: auto;
}
/* == Price == */
.price {
/* add more customizations here */
}
/* == App rating == */
.reviews {
border: none;
line-height: 1.1em;
}
.rating-star {
display: inline;
float: left;
height: 1.1em;
width: 1.1em;
}
/* == Url == */
.url {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* == Attribution == */
.attribution {
background-color: #fbb320;
border-radius: 2px;
color: #ffffff;
display: table;
font-size: 13px;
line-height: 13px;
margin: 4px 4px 8px 16px;
padding: 0 3px;
position: absolute;
top: 0;
left: 0;
}
.rtl .attribution {
left: auto;
right: 0;
}
/* == Other == */
.ads a {
text-decoration: none;
}
.ads, .ad {
/**
* DO NOT TOUCH OR REMOVE
* Will break image rendering
*/
height: 100%;
width: 100%;
padding: 0;
word-wrap: break-word;
}
.ad {
/* Padding for attribution */
padding-top: 23px;
height: calc(100% - 23px);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.