Bigcartel mobile only - html

I'm trying to get my bigcartel page to show
<div style="margin-top: 0px; img align: middle">
<img width="420" height="42" style="vertical-align:middle;" src="https://i.imgsafe.org/52c5068376.png" alt="PAF ENTRY">
</div>
on mobile devices only while trying to show an exact copy of the code for browsers only
here is the page
http://pafclub.bigcartel.com/entry
And this is what I have so far:
<div class="mobileHide">
<div style="margin-top: 0px; img align: middle">
<img width="420" height="42" style="vertical- align:middle;" src="https://i.imgsafe.org/52c5068376.png" alt="PAF ENTRY"> </div>
<style type="text/css">
.mobileHide { display: inline;}
/* Smartphone Portrait and Landscape */
#media only screen
and (min-device-width : 320px)
and (max-device-width : 480px){ .mobileHide { display: none;}}
</style>
<div class="mobileShow">
<div style="margin-top: 120px; margin-bottom: 10px; text-align: center;">
<img width="420" height="42" style="vertical-align:middle;" src="https://i.imgsafe.org/52c5068376.png" alt="PAF ENTRY">
</div>
<style type="text/css">
.mobileShow { display: none;}
/* Smartphone Portrait and Landscape */
#media only screen
and (min-device-width : 320px)
and (max-device-width : 480px){ .mobileShow { display: inline;}}
</style>
it shows one version of the image but when I check on a mobile device there is no image at all.

The theme has code that adds a margin to custom page bodies that you'll need to override. Add this to the bottom of Customize Design > Advanced > CSS to remove it:
#entry .page {
margin: 0 auto;
}
Then for your entry page, all you'll need is the following code to have the image display centered properly (on desktop and mobile)
<a href="/products">
<img style="width:100%;margin:0 auto;max-width: 427px;display:block" src="https://i.imgsafe.org/7da3920e19.png" alt="ENTRY">
</a>

i have worked on your problem, and got solution for this. Please check the code.
.mobileHide { display:table; height:100%; text-align:center; vertical-align:center; width:100%;}
.middle{ display:table-cell; height:100%; vertical-align:middle; width:100%;}
.middle a{ max-width:80%; display:inline-block;}
.middle a img{ max-width:100%;}
html, body {
height: 100%;
margin: 0px;
}
<div class="mobileHide">
<div class="middle">
<a href="/products">
<img width="420" height="" src="https://i.imgsafe.org/52c5068376.png" alt="PAF ENTRY">
</a>
</div>
<div style="clear:both;"></div>
</div>

Related

Image gallery not working properly

<section>
<style>
div.img {
border: 1px solid #ccc;
}
div.img:hover {
border: 1px solid #777;
}
div.img img {
width: 100%;
height: auto;
}
div.desc {
padding: 15px;
text-align: center;
}
* {
box-sizing: border-box;
}
.responsive {
padding: 0 6px;
float: left;
width: 24.99999%;
}
#media only screen and (max-width: 700px) {
.responsive {
width: 49.99999%;
margin: 6px 0;
}
}
#media only screen and (max-width: 500px) {
.responsive {
width: 100%;
}
}
.clearfix:after {
content: "";
display: table;
clear: both;
}
</style>
<div class="responsive">
<div class="img">
<a target="_blank" href="img\aviary-image-1479454871589.jpeg">
<img src="/img/aviary-image-1479454871589.jpeg" alt="A Boeing 747-400 descending" width="300" height="200">
</a>
<div class="desc">A Boeing 747-400 descending</div>
</div>
</div>
<div class="responsive">
<div class="img">
<a target="_blank" href="img\Screenshot_2016-11-18-13-30-35-973.jpg">
<img src="/img/Screenshot_2016-11-18-13-30-35-973.jpg" alt="Boeing 787-9 touching down" width="600" height="400">
</a>
<div class="desc">Boeing 787-9 touching down</div>
</div>
</div>
<div class="responsive">
<div class="img">
<a target="_blank" href="img\Slack for iOS Upload.jpg">
<img src="/img/Slack for iOS Upload.jpg" alt="Boeing 777-200ER climbing" width="600" height="400">
</a>
<div class="desc">A Boeing 777-200ER climbing</div>
</div>
</div>
</section>
Please note, that this is only a section of the page, that is why there are no starting tags etc.
For some reason, my gallery is not loading. The images are uploaded, but none of the gallery is showing up on the site. You can look at the site here: https://britishairways.000webhostapp.com/photos.html
Anything I'm doing wrong?
Thank you!
Make your <section> in which your gallery items are located a flex container. Just like:
section {
display: flex;
}
Visual Reference:
The section holding the three gallery images has zero height. This, in turn, is because the gallery images have float:left, which takes them out of the layout flow and causes their parent not to use their size in calculating its height.
See How do you keep parents of floated elements from collapsing?

Three images side by side, responsive without scaling

I cannot find the exact answer to my question, so hopefully someone can help me.
I have three images. I want them side by side on a large screen.
On a smaller screen (tablet) I want two of them to be in rows.
And on small phone screen I want them all to be in rows above each other, centered.
The code that I have so far is:
<div align="center">
<div style="width: 371px; float: left;"><img src="{{media url="wysiwyg/magenthemes2/images/review1.png"}}" alt="" width="371" height="270" /></div>
<div style="width: 371px; float: left;"><img src="{{media url="wysiwyg/magenthemes2/images/review2.png"}}" alt="" width="371" height="139" /></div>
<div style="width: 371px; float: left;"><img src="{{media url="wysiwyg/magenthemes2/images/review3.png"}}" alt="" width="371" height="139" /></div>
</div>
But this doesn't work right. It is also not centered. I'd like it to render like this:
Responsive example on different screen sizes
The best way to do this is to give the parent <div> a class name, and then apply different styles to it in different #media queries. More can be read about #media at MDN. you could use this site, or this site for a simpler but less complete overview, as a cheatsheet for which media queries you could use.
An example of some code that would work for a selection of devices is:
#media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
.imagebox > img {
float:left;
}
}
#media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
.imagebox > img:first-child {
float:left;
}
}
<div align="center" class="imagebox">
<div style="width: 371px; float: left;"><img src="https://placekitten.com/250/300" alt="" width="371" height="270" /></div>
<div style="width: 371px; float: left;"><img src="https://placekitten.com/250/150" alt="" width="371" height="139" /></div>
<div style="width: 371px; float: left;"><img src="https://placekitten.com/250/150" alt="" width="371" height="139" /></div>
</div>
Instead of float you can also work with the text-align attribute. In the following example you can see how I used it for boxes on a front-page. They automatically adjust to different screen-sizes (click on "Run code snippet" and then on "Full page").
.entries-box {
/* Style for box containing Frontpage boxes */
text-align: center;
padding: 0;
}
.entry {
/* Style for a Frontpage box */
display: inline-block;
text-align: left;
padding: 0.4em 0.8em 0.4em 0.8em;
border: 1px solid black;
margin: 0 1em 0.4em 0;
border-radius: 10px;
background: #007f59;
}
<div class="entries-box">
<div class="entry newest-e">
<b>Title of Storie</b> - Genre (Lang icon)
<br>'Excerpt of newest entry, max. 2 lines
<br>Second line of excerpt...'
<br>_User_
</div>
<div class="entry newest-e">
<b>Title of Storie</b> - Genre (Lang icon)
<br>'Excerpt of newest entry, max. 2 lines
<br>Second line of excerpt...'
<br>_User_
</div>
<div class="entry newest-e">
<b>Title of Storie</b> - Genre (Lang icon)
<br>'Excerpt of newest entry, max. 2 lines
<br>Second line of excerpt...'
<br>_User_
</div>
</div>

Text is centre aligned on computer and phone simulator, but not on actual phone?

My code is from bootstrap, but what I am trying to do is add a fig caption below an image that is center aligned for only smaller screens. When I check on my computer and shrink the window, the fig caption appears and is center aligned, when i check the code on a phone simulator (for example iphone5), it is also center aligned, but when I then upload the file to the server and check my phone (which is an iphone5), the text is not center aligned like on the simulator, but is instead left aligned. So my question is what is causing this error, and how do I fix it to be center aligned.
Also, I have the footer coded in a way to disappear on smaller screens. It is the same issue as above. It disappears when i shrink the window or when I check on the phone simulator, but it doesn't disappear on the actual phone.
Thanks for the help.
HTML:
<div class="col-xs-12 col-sm-9" style="padding: 0px;">
<img src="example.jpg" style="max-width:100%; margin-top: 48px;" alt="example"></img>
<figcaption>Details</figcaption>
</div>
<footer class="footer" style="background-color: #ffffff;">
<div class="container">
<p class="text-muted">Details</p>
</div>
</footer>
CSS:
#media screen and (min-device-width : 768px) {
figcaption {
display: none;
}
#media screen and (max-width: 767px) {
figcaption {
display: block;
text-align: center;
}
#media screen and (max-width: 767px) {
.footer {
display: none;
}
It looks like you're missing the closing brackets around your #media queries.
Should be:
#media screen and (min-device-width : 768px) {
figcaption {
display: none;
}
}
#media screen and (max-width: 767px) {
figcaption {
display: block;
text-align: center;
}
}
#media screen and (max-width: 767px) {
.footer {
display: none;
}
}
But, instead of doing it manually, you could use the Bootstrap responsive utility classes. To do what you're looking for:
<div class="col-xs-12 col-sm-9" style="padding: 0px;">
<img src="example.jpg" style="max-width:100%; margin-top: 48px;" alt="example"></img>
<figcaption class="visible-xs-block text-center">Details</figcaption>
</div>
<footer class="footer hidden-xs" style="background-color: #ffffff;">
<div class="container">
<p class="text-muted">Details</p>
</div>
</footer>
i have add bootstrap class text-center in figcaption below plz refer it
<div class="col-xs-12 col-sm-9" style="padding: 0px;">
<img src="example.jpg" style="max-width:100%; margin-top: 48px;" alt="example"></img>
<figcaption class="visible-xs-block text-center">Details</figcaption>
</div>
<footer class="footer hidden-xs" style="background-color: #ffffff;">
<div class="container">
<p class="text-muted">Details</p>
</div>
</footer>

HTML: Stop pictures from overlap on mobile view (responsive design)

I've got a website, based on wordpress and the responsive design "Mystile".
I use the following html code to display three pictures side by side:
<div style="position: absolute;"><img src="myimgsrc" alt="" /></div>
<div style="position: absolute; margin-left: 250px;"><img src="myimgsrc" alt="" /></div>
<div style="position: absolute; margin-left: 500px;"><img src="myimgsrc" alt="" /></div>
This works flawlessly on the computer.
As you can see on the picture.
But on a mobile device it looks terrible.
Like this:
What can should I do?
Thank you very much.
The easiest is just to display the images inline. They will then wrap under each other if there isn't enough space to fit beside one another:
html, body {margin:0;}
.hmm a {display:inline-block; margin:10px 0 0 10px;}
.hmm a img {display:block; margin:0;}
<div class="hmm"><img src="http://www.placehold.it/240x50" alt="placeholder" /><img src="http://www.placehold.it/240x50" alt="placeholder" /><img src="http://www.placehold.it/240x50" alt="placeholder" /></div>
If you want to get a little more advanced you can use media-queries to change the style for different sized viewports:
html, body {margin:0;}
.hmm a {display:inline-block; margin:10px 0 0 10px;}
.hmm a img {display:block; margin:0;}
#media all and (max-width: 750px) {
.hmm a:first-of-type img {width:490px;}
}
#media all and (max-width: 510px) {
.hmm a {
display: block;
margin:10px;
}
.hmm a img {
width:100%!important;
}
}
<div class="hmm"><img src="http://www.placehold.it/240x50" alt="placeholder" /><img src="http://www.placehold.it/240x50" alt="placeholder" /><img src="http://www.placehold.it/240x50" alt="placeholder" /></div>
^ Go 'full-page' and resize to see this one working.

Align DIVs centered and next to eachother

I am making a gallery and am stuck on a problem.
I want to have thumbnails of images next to eachother, in the center, I also want to have different groups which are under eachother.
Here's what I have: JsFiddle link.
How do I make group 1 and 2's images centered and next to eachother and how can I make group 2 under group 1?
Thanks in advance!
Here's the code without JsFiddle:
Html:
<html>
<head>
<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/lightbox.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
<link href="css/lightbox.css" rel="stylesheet" />
</head>
<body>
Group 1: <br>
<div class="img">
<a href="img/een.jpg" data-lightbox="Group-1">
<img src="img/een.jpg" alt="Een" width="100" height="100">
</a>
</div>
<div class="img">
<a href="img/twee.jpg" data-lightbox="Group-1">
<img src="img/twee.jpg" alt="Twee" width="100" height="100">
</a>
</div>
<br>
Group 2: <br>
<div class="img">
<a href="img/drie.jpg" data-lightbox="Group-2">
<img src="img/drie.jpg" alt="Drie" width="100" height="100">
</a>
</div>
<div class="img">
<a href="img/vier.jpg" data-lightbox="Group-2">
<img src="img/vier.jpg" alt="Vier" width="100" height="100">
</a>
</div>
</body>
</html>
CSS:
div.img {
height: auto;
width: auto;
float: left;
}
div.img img {
display: inline;
margin: 5px;
opacity: 0.5;
}
div.img a:hover img {
opacity: 1;
}
Just wrap your groups in a div.
HTML
<div class="group">
Group 1: <br>
<div class="img">
<a href="img/een.jpg" data-lightbox="Group-1">
<img src="img/een.jpg" alt="Een" width="100" height="100">
</a>
</div>
<div class="img">
<a href="img/twee.jpg" data-lightbox="Group-1">
<img src="img/twee.jpg" alt="Twee" width="100" height="100">
</a>
</div>
</div>
CSS :
div.img {
display:inline-block;
}
DEMO
Example
Slightly amend your HTML and CSS to the below. Crucially you want to wrap your img within a parent element with text-align:center; set, you can accomplish this using e.g. the below (see here for centred titles):
Group 1:
<br>
<div class="img"> <a href="img/een.jpg" data-lightbox="Group-1">
<img src="img/een.jpg" alt="Een" width="100" height="100" />
</a>
<a href="img/twee.jpg" data-lightbox="Group-1">
<img src="img/twee.jpg" alt="Twee" width="100" height="100" />
</a>
</div>
Group 2:
<br>
<div class="img"> <a href="img/drie.jpg" data-lightbox="Group-2">
<img src="img/drie.jpg" alt="Drie" width="100" height="100" />
</a>
<a href="img/vier.jpg" data-lightbox="Group-2">
<img src="img/vier.jpg" alt="Vier" width="100" height="100" />
</a>
</div>
CSS
div.img {
text-align:center;
}
a {
text-decoration:none;
}
div.img img {
display: inline;
margin: 5px;
opacity: 0.5;
}
div.img a:hover img {
opacity: 1;
}
Here you can fit such a decision
DEMO
<div class="galleryItem">
<img src="http://imgsrc.ru/images/reco/140/windkitten_38083968.jpg" alt="">
<h3>Title</h3>
<p>Lorem ipsum dolor sit amet...</p>
</div>
.........
.container {
width: 80%;
margin: 30px auto;
overflow: hidden;
}
.galleryItem {
color: #797478;
font: 10px/1.5 Verdana, Helvetica, sans-serif;
float: left;
}
.galleryItem h3 {
text-transform: uppercase;
}
.galleryItem img {
max-width: 100%;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.galleryItem {
color: #797478;
font: 10px/1.5 Verdana, Helvetica, sans-serif;
float: left;
width: 16%;
margin: 2% 2% 50px 2%;
}
/* MEDIA QUERIES*/
#media only screen and (max-width : 940px),
only screen and (max-device-width : 940px){
.galleryItem {width: 21%;}
}
#media only screen and (max-width : 720px),
only screen and (max-device-width : 720px){
.galleryItem {width: 29.33333%;}
}
#media only screen and (max-width : 530px),
only screen and (max-device-width : 530px){
.galleryItem {width: 46%;}
}
#media only screen and (max-width : 320px),
only screen and (max-device-width : 320px){
.galleryItem {width: 96%;}
.galleryItem img {width: 96%;}
.galleryItem h3 {font-size: 18px;}
.galleryItem p, {font-size: 18px;}
}
To centralize the images, place a wrapper div around them.
To ensure that group 2 is below group 1, you can either place a div with CSS clear property after the first group or use the CSS after selector to get the same effect without actually changing the html.
(In this sample code, I am inserting an extra div after the first group.)
HTML
Group 1:
<div class="img">
<a href="img/twee.jpg" data-lightbox="Group-1">
<img src="img/twee.jpg" alt="Twee" width="100" height="100" />
</a>
</div>
<br>
<div class='clearfix'></div>
Group 2: <br>
<div class="img">
<a href="img/drie.jpg" data-lightbox="Group-2">
<img src="img/drie.jpg" alt="Drie" width="100" height="100" />
</a>
</div>
<div class="img">
<a href="img/vier.jpg" data-lightbox="Group-2">
<img src="img/vier.jpg" alt="Vier" width="100" height="100" />
</a>
</div>
</body>
</html>
CSS
div.img {
height: auto;
width: auto;
float: left;
text-align:center;
}
div.img img {
display: inline;
margin: 5px;
opacity: 0.5;
}
div.img a:hover img {
opacity: 1;
}
div.clearfix{
clear:both;
}
(Please note that you should always use a slash before closing the img tag)