I've tried this yesterday and it worked fine for me, it's basic enough, I just want to have a few lines of text overlay a background image (at 'nk'). Somewhere something has gone wrong - when the background image is at full size (which only seems to be possible by adding a png transparent image - full height not full width - to 'fill' it out) then the text seems to be forced from the containing div and its background image.
I'm using a drag and drop builder called Visual Composer, in this you can work with rows - .histy is the class I've attached to the problem div/row
and here is the page with the text problem:
http://dbtest.destinationballybunion.ie/?page_id=2755
Any ideas why now the text is being forced out of the containing div ? Thanks.
CSS for this page:
#container {
margin: 0%;
}
#container text area {
margin: 5%;
}
wrapper {
padding: 0px;
margin-top: 0px;
margin-bottom: 0px;
}
entry {
box-shadow: 0 0 0px rgba(0, 0, 0, 0);
padding: 0px;
}
entry-header.style {
position: absolute;
left: -9999px;
}
.entry-content a img,
#attachment-nav a img {
max-width: 98.5%;
padding: 0%;
box-shadow:0 0 3px #EEE;
background:#FFF;
border:#EEE 1px solid;
}
.entry-title {
display:none;
}
.single .entry, .page .entry, .error404 .entry {
margin-bottom: 5.1% !important;
padding: 0;
}
#site-title {
height:100%;
width:100%;
}
#site-title, #site-description {
line-height: 100%;
}
#site-title {
margin: 0 0;
}
#site-title img {
margin: 0;
}
#site-title img {
padding: 0;
}
#access {
background: url('http://dbtest.destinationballybunion.ie/wp-content/uploads/2014/03
/HISTORY-MENU-TOP.jpg');
background-repeat:no-repeat;
background-size: 100% 100%;
background-size: cover;
}
.histy {
background: url('http://dbtest.destinationballybunion.ie/wp-content/uploads/2014/06
/HISTORY-1-NT.jpg');
background-repeat:no-repeat;
background-size: 100% 100%;
background-size: contain;
}
.tourguides {
margin-top: 20px;
}
.walkback {
background-size: 100% 100%;
}
.walktrans {
height:100%;
width:100%;
}
.walktext {
background-color: transparent;
}
.walktext {
margin-top: 2.0vh;
}
.walktext p {
font-size: 24px;
font-size: 2.8vw;
}
.walktext p {
padding-left: 0.8vw;
padding-right: 2.5vw;
}
.walktext a {
color: #BD8346;
}
.walktext a:hover {
color: #827265;
}
.trailmenu h4 {
font-size: 23px;
}
.trailmenu h4 {
overflow: auto;
}
.trailmenu h4 span {
padding-top: 0px;
padding-right: 3px;
}
.trailmenu h4 span{
display: block;
float: left;
}
.trailmenu h4 img{
float: right;
padding-top: 10px;
}
.trailmenu h4 img {
vertical-align:text-bottom;
}
h5 {
font-size: 21px;
}
h5 {
overflow: auto;
}
h5 span {
padding-top: 0px;
padding-right: 3px;
}
h5 span{
display: block;
float: left;
}
h5 img{
float: right;
padding-top: 20px;
}
h5 img {
vertical-align:text-bottom;
}
Related
I'm new to CSS and have encountered a problem. I'm trying to display paragraphs on my website on desktop/global view as
#aeromexico
p {
float: left;
position: fixed;
text-align: left;
max-width: 25%;
padding: 0px 0px 0px 0px;
display:inline-block;
}
but when viewed in mobile and tablet I want them to be viewed as
#aeromexico .col-sm
p {
object-position: top;
text-align: left;
max-width:100%;
display:block;
padding-bottom: 60px;
}
However the second part of the code for mobile view is being ignored and is still displaying as desktop view on mobile. I have attached my whole code below
/Desktop / Global View/
body {
max-width: 1366px;
margin-left: auto;
margin-right: auto;
font-family: 'Open Sans', sans-serif;
padding: 1px;
}
#homepage .col {
float: left;
}
.col-lg {
width: 33.3%;
}
.col-lg img {
width: 100%;
height: auto;
display: block;
}
.slicknav_menu {
display:none;
}
#menu {
float: right;
}
#menu li {
display:inline-block;
}
#menu li a {
text-decoration:none;
color: #454545;
padding: 8px;
font-size: 18px;
}
header {
padding: 10px 0px 20px 0px;
}
ul {
padding-top: 40px;
}
.mylogo {
width: 95px;
}
/*aeromexico*/
#aeromexico .row {
padding:5px;
}
#aeromexico .col {
width: 70%;
margin-right: auto;
float: right;
display:inline-block;
padding-bottom: 40px;
}
#aeromexico .col-lg {
width: 65%;
}
#aeromexico
p {
float: left;
position: fixed;
text-align: left;
max-width: 25%;
padding: 0px 0px 0px 0px;
display:inline-block;
}
/*Tablet View*/
#media (max-width: 768px) {
#menu li {
display:block;
text-align: right;
}
header {
padding:10px;
}
.col-md {
width: 50%;
}
.mylogo {
width: 95px;
}
body {
padding:10px;
}
}
/*Mobile View*/
#media (max-width: 400px) {
.slicknav_menu {
display:block;
}
#menu {
display:none;
}
alt {
width: 95px;
}
.mylogo {
width: 95px;
}
.col-sm {
width:100%;
}
body {
padding:10px;
}
#aeromexico .col-sm {
width:100%;
}
#aeromexico .col-sm
p {
object-position: top;
text-align: left;
max-width:100%;
display:block;
padding-bottom: 60px;
}
}
Did you set up the metatag for the viewport on the HTML header?
<meta name="viewport" content="width=device-width, initial-scale=1">
I am developing a Wordpress site using a child theme and cornerstone page builder.
Cornerstone allows full width images with no containers for normal pages but not posts. How do I make the post include a full width image?
I want to make this: http://www.crestonsolutions.com/test-post/
Look like this: http://www.crestonsolutions.com/blog/how-to-keep-customers-coming-back-to-your-site/
Here is the CSS I've done to the site:
.x-navbar {
background-color: transparent !important;
border: 0;
}
.x-logobar{
background-color: transparent !important;
}
.masthead {
height:0px;
}
.x-nav-wrap.mobile {
background: rgba(17, 17, 17, 0.60);
margin: 0;
}
.x-btn-navbar.collapsed {
color: white;
}
#media (max-width: 979px){
.x-navbar-inner .x-container.max.width {
width: auto;
max-width: none;
}
.masthead-inline .x-btn-navbar {
margin-right: 15px;
}
.x-navbar .x-brand {
margin-left: 15px;
}
ul#menu-main-menu-1 {
width: 88%;
margin-left: auto;
margin-right: auto;
}
.x-navbar {
background-color: rgba(17, 17, 17, 0.60)!important;
position: fixed;
top: 0;
left: 0;
width: 100%;
}
.x-nav-wrap.mobile.collapse.in {
height: 100%;
position: fixed;
width: 100%;
top: 90px;
}
.x-navbar .x-nav-wrap .x-nav > li > a {
text-align: center;
font-size: 46px;
border: none;
margin-top: 0px;
margin-bottom: 0px;
padding-top: 0px;
padding-bottom: 0px;
}
}
hr.x-hr {
width: 20%;
border-top: 3px solid rgba(0,0,0,0.075);
margin: 0 auto;
}
.single-post .x-navbar {
color: black;
}
.single-post .entry-header {
display: none;
}
.single-post .site > .x-container-fluid {
max-width: 100% !important;
width: 100% !important;
}
.single-post .x-navbar a {
color: black;
}
I am working on a page that I'm trying to make responsive. I'm using background images and trying to lay them out one under the other but when adding the margin-top property using responsive units (vh, em, rem, %) my background image moves but there's a big variation on where the images should be on a laptop screen and an Ipad screen.
LINK:
http://dbtest.destinationballybunion.ie/?page_id=3733
As I've said I tried using all the responsive units and i keep getting the same variation in results. Is there a way this can be fixed without using media queries ?
PS I am using a drag and drop Wordpress plugin called Visual Composer
CSS FOR THE PAGE:
#container {
margin: 0%;
}
#container text area {
margin: 5%;
}
wrapper {
padding: 0px;
margin-top: 0px;
margin-bottom: 0px;
}
entry {
box-shadow: 0 0 0px rgba(0, 0, 0, 0);
padding: 0px;
}
entry-header.style {
position: absolute;
left: -9999px;
}
.entry-content a img, #attachment-nav a img {
background: none repeat scroll transparent;
border: 0px solid #EEEEEE;
box-shadow: 0 0 0px #EEEEEE;
max-width: 98.5%;
padding: 0%;
}
.entry-content a:hover img, #attachment-nav a:hover img {
background: transparent repeat scroll 0 0;
}
.entry-title {
display:none;
}
.single .entry, .page .entry, .error404 .entry {
margin-bottom: 5.1% !important;
padding: 0;
}
#site-title {
height:100%;
width:100%;
}
#site-title, #site-description {
line-height: 100%;
}
#site-title {
margin: 0 0;
}
#site-title img {
margin: 0;
}
#site-title img {
padding: 0;
}
#access {
position: relative;
margin-top:-0.5%;
}
.tearhist {
background-size: 100% 100%;
background-size: contain;
background-repeat:no-repeat;
}
.tearhist {
position: absolute;
margin-top: -11.000em;
z-index: 100;
}
.tearytext {
position: absolute;
margin-top: 2.500em;
margin-right: 2.500em;
}
.tearytext h4 {
font-size: 24px;
font-size: 1.100em;
line-height: 100%;
}
.histmainb {
background-size: 100% auto;
background-repeat:no-repeat;
}
.histmainb {
position: relative;
}
.histblocka {
background-image: url('http://dbtest.destinationballybunion.ie/wp-content/uploads
/2014/10/HISTOBACK-1-SMALL.png');
background-size: auto auto;
background-size: contain;
background-repeat:no-repeat;
}
.histblocka {
position: absolute;
}
.histblocka p {
margin-right: 23.000em;
margin-left: 3.500em;
}
.histblocka h2 {
margin-top: 3.500em;
margin-left: 3.000em;
}
.histblocka h2 {
text-shadow: 0px 2px 3px #666;
}
.histblocka p {
font-size: 1.000em;
}
.histblocka h2 {
font-size: 1.000em;
}
.nublockb {
position: absolute;
margin-top: 21.000em;
}
.nublockb {
background-image: url('http://dbtest.destinationballybunion.ie/wp-content/uploads
/2014/10/HISTOBACK-3-SMALL.png');
background-size: auto auto;
background-size: contain;
background-repeat:no-repeat;
}
my bootstrap mobile style won't render unless I add a extra closing brace to the end can someone tell me what I did wrong
this is the styles that I created and they should work but they are not working and they pass the validator test.
#media only screen and (max-width: 766px){
.movie{
width:300px;
height: 300px;
margin:0;
padding:0;
}
body > div > div > h3 {
margin-left: 300px;
padding-top: 200px;
}
a:link {
outline: 0;
font-size: 9px;
display: block;
padding-right: 50px;
}
h3{
font-size: 20px;
margin-top:20%;
}
h3.port {
margin-left: 150px;
color: #9932CC;
margin-top: 50px;
}
img {
float: left;
margin-right: 15px;
width:50%;
height:50%;
margin-top:0;
}
p {
margin-left: 10px;
margin-top:5%;
padding: 0;
color: #9932CC;
font-size: 15px;
}
.navbar .nav > li > a {
color: #9932CC;
}
body > div > div > a > img {
display: none;
}
.navbar-brand {
float: left;
padding: 10px 15px;
font-size: 20px;
}
/* twitter
====================================== */
div#iPhone {background: url("../images/iphone.png") no-repeat;
width:275px;height:500px;
display: inline-block;
padding-top: 90px;
padding-left:2em;
margin-left: 0px;
}
iframe#twitter-widget-0.twitter-timeline[style] {width:70px !important;}
div#iPhone iframe[id^="twitter-widget-0"] {min-width:170px !important;
margin-right: 20px;
}
/* iframe
======================================= */
.movie {
text-align: center;
width: 350px;
height: 345px;
margin-left: 0px;
margin-right: 200px;
}
.paragraph {
width: 50px;
margin-left: 10%;
}
.thumbnail {
color: #333;
margin-left: 100%;
width: 100%;
background-color: transparent;
border:0px;
}
.btn-primary {
color: #000;
background-color: #aff6b8;
border-color:black;
margin-top: 5%;
width:100%;
}
}
}
mobile style won't render unless I add a extra closing brace to the end
Yes, the #media syntax involves an extra set of braces:
#media only screen and (max-width: 766px) {
element {}
}
The last closing brace you added is equivalent to the last one in the code above.
I've got a container div (the background in the picture below) and an inner div that contains images (social icons).
I want my images to overflow out of the bounds of the container div (as you can see in the image), but at the same time I want the container to resize: its height should decrease when my images overlap its top border. So there shouldn't be that lower empty border: the container behaves like if the images were fixed, while they are not.
Here's the image:
How can I do that?
EDIT: This is what I'd like to obtain (well, something like this I mean :P )
The height of the container div (the dark background you see) is dynamically set by its content.
try giving the position of inner div to position:absolute in relative with the parent div
then you can play around with the inner divs by adjusting the top,left,bottom and right properties
// css
body{ background: url("http://1.bp.blogspot.com/-OowkzBiSOJU/Ud0G3T325lI/AAAAAAAACfY/syhVEMuuSOw/s1600/tiny_grid.png") repeat scroll 0 0 transparent; color: #666; height: 100%; padding: 0; font-family: 'Lora',Georgia,Serif; font-size: 18px; line-height: 29px; border-top: 5px solid #4690B3; }
.clr { clear:both; float:none; }
.ct-wrapper { padding:0px 20px; position:relative; max-width:1230px; margin: 0 auto; }
.header-wrapper {
background: #fff; border-bottom: 1px solid #ccc; display: inline-block; float: left; width: 100%; }
/***** Optin Form CSS *****/
.opt-in .inner { background: url("http://3.bp.blogspot.com/-YfUnP1wOFzQ/Ud0G21XXRWI/AAAAAAAACfQ/Hg5Gakd69tQ/s1600/home-bg.png") repeat scroll 0 0 transparent; padding: 10px 0 0; font-style: italic; color: #ccc; text-shadow: 0 1px 1px #000000; margin-top:50px;height:50px; }
.opt-in .opt-in-wrap { margin-right: 40%; }
.opt-in .info { float: left; width: 80%; }
/*****************************************
Responsive styles
******************************************/
#media screen and (max-width: 1024px) {
#header, .header-right { float: none; text-align: center; width: 100%; }
.header-right .widget-content { margin: 0; }
}
#media screen and (max-width: 960px) {
.ct-wrapper{ padding:0 15px; }
.main-wrapper, .opt-in .opt-in-wrap{ margin-right:0; width:100%; }
.sidebar-wrapper{ float: left; width: auto; margin-left: 20px; }
.nav-menu ul { text-align: center; }
.nav-menu ul li { float: none; }
.opt-in .inner .ct-wrapper { padding: 0 48px; }
.opt-in .info { text-align: center; }
.opt-in .signup-form { margin-top: 30px; width: 95%; float: left; }
#subbox { width: 60%; }
}
#media screen and (max-width: 768px){
#header p.description { margin: 0; }
.header-right { display: none; }
#comment-editor { margin:10px; }
.footer { width: 50%; }
}
#media screen and (max-width: 500px){
#header img { width:100%; }
.opt-in .inner .ct-wrapper { padding: 0 10px; }
}
#media screen and (max-width: 420px){
.comments .comments-content .datetime{ display:block; float:none; }
.comments .comments-content .comment-header { height:70px; }
}
#media screen and (max-width: 320px){
.footer { width: 100%; }
.ct-wrapper{ padding:0; }
.post-body img{ max-width: 220px; }
.comments .comments-content .comment-replies { margin-left: 0; }
}
/*****************************************
Hiding Header Date and Feed Links
******************************************/
h2.date-header{display:none;}
.opt-in .social-div {
background: rgba(0, 0, 0, 0.0);
border: none;
float: right;
font-size: 16px;
text-align: center;
position: absolute;
top: -55px;
}
.opt-in .social-div .form-inner { font-size: 16px; margin: 35px; }