I'm using bootstrap 3 in one of my application. If I use width="80%" height="420" then my video comes with perfect size in large screens. But it is not working as responsive in small screens (mobiles) because of height="420". So that I used class="embed-responsive-item" with iframe. Again same problem iframe is not working as responsive. Any suggestions please. I'm not familiar with css. Here is some stuff.
<div class="wrapper">
<aside class="right-side">
<section class="content">
<div class="row">
<div class="col-xs-9">
<div style="background-color: #ffffff;text-align:center;padding:1%;" id="tmp">
<iframe id="crntplay" width="80%" height="420" src="http://www.youtube.com/embed/id?autoplay=0" allowfullscreen></iframe>
<div class="row">
<div class="col-md-8"><span id="crntplaytitle" style="margin-left:15%;text-align:left;display: block;font-size:14pt;font-weight:bold;">title</span></div>
<div class="col-md-2"><span id="crntplayviews" style="text-align:right;display: block;font-size:14pt;font-weight:bold;">views</span></div>
</div>
</div>
</div>
</div>
</section><!-- /.content -->
iframe can't be responsive. Just the contents in them.
You could use jquery to resize the iframe based on screen resolution
Adjust width and height for iframe depending on screen size
Related
I'm putting an embedded Google Map side by side with a responsive image inside a div. I want the map to be the same size as the image always, and resize as it does.
This is my code, and the map looks really small.
<div class="grid-container">
<div class="grid12-6 no-gutter">
<img src="http://1.bp.blogspot.com/-MoFU-ybvlUw/TsXyHlX2AlI/AAAAAAAAARQ/kqXxZ8SquX8/s1600/la+fotolego.JPG" alt="" />
</div>
<div class="grid12-6 no-gutter">
<div class="map-container">
<div class="mapa">
<iframe src="https://maps.google.com/maps?q=manquehue%20norte%201255&t=&z=14&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>
</div>
</div>
</div>
I want it to look like this
Possibly, you will have to keep your parent as a display: flex; and the childrens as flex-items or inline.
Bootstrap Grids
I'm having an problem with the Bootstrap grid system can't seam to position my content the right way that I want to. Here is what I have so far.
<header>
<div class="container-fluid">
<div class="row">
<div class="col-md-2"><img src="logo.png" alt="" class="img-responsive"/></div>
<div class="col-md-2"><h3>My Website</h3></div>
</div>
</div>
</header>
Goal
What I want to achieve is to have a full width web page for large desktops and responsive for mobiles where the logo image and the "My website" slogan will be on the left and the content will be positioned in the center.
Here are some images of what i want to achieve on desktop and mobile http://s16.postimg.org/tbt4b5det/Untitled_1.png - Desktop
http://s10.postimg.org/mbijfjvkp/Untitled_2.png - Mobile
check below what have:
<section>
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<img src="/logo.png" alt="" class="img-responsive"/>
</div>
<div class="col-md-6 col-md-offset-3"><h4>Welcome</h4></div>
<div class="col-md-6 col-md-offset-3"><h4>How are you?</h4></div>
<div class="col-md-6 col-md-offset-3">
<div class="disclaimer">
<p>Some text here</p>
</div>
<div class="link">
<span>Follow Us</span>
</div>
</div>
</div>
</div>
</section>
Other Issues
It seams every time i test for different devices or simple resize the browzer the image goes extra small until it get to sm devices and than again continues to get smaller.
Thank You
I thank you for your help i'm new in web development any suggestion is appreciated.
The way I'd do it is by changing the container class to <div class="container-fluid" style="text-align:left;"> allowing for full width usage of a screen.
Then, just put a <div style="text-align: center;"> around what you want to center.
Though this will make all elements stretch the entire screen width, including the col-*-* classes. Just add col-*-offset-* as required to adjust for this.
Your img is getting smaller because of the img-responsive class.
So, I have written a page in AMP HTML, and I have a DIV I want to hide when someone views the page on mobile, but I want it shown when it's on a resolution such as Desktop or Tablet. I have Bootstrap enabled and all of the CSS is styled in the of the document, per AMP Standards.
<section class="about" id="about" alt="about">
<div class="col-md-6">
<p>Example Content</p>
</div>
<div class="col-md-6">
<amp-img src="example.jpg" alt="Example" height="400" width="800"></amp-img>
</div>
</section>
I want the second DIV in the Section to be hidden on Mobile.
Bootstrap has classes for this sort of thing. Use them individually or in combination to achieve the desired result.
hidden-xs
http://getbootstrap.com/css/#responsive-utilities-classes
With CSS3 media queries you can make CSS act different in different resolutions.
Example:
#media screen and (min-width: 480px) {
#yourdiv {
visibility: hidden;
}
}
Here is complete tutorial:
http://www.w3schools.com/css/css3_mediaqueries.asp
Just add .hidden-xs class to the element you want to hide from mobile device.
<section class="about" id="about" alt="about">
<div class="col-md-6">
<p>Example Content</p>
</div>
<div class="col-md-6 .hidden-xs">
<amp-img src="example.jpg" alt="Example" height="400" width="800"></amp-img>
</div>
</section>
Hello im creating a web site with Bootstrap 3, everything was going well till i tried to put a Youtube video in my site, so i used responsive embed class that Bootstrap provides but when i display the content of my website the video doesn't show it, i've tried many things like copying the code exactly of Bootstrap page but it still does not work!. Can someone help me?. This is my code:
<!-- PROMOTIONAL VIDEO -->
<section class="wrap" id="promo-video">
<div class="container">
<div class="header-section">
<h2>Mira el video de presentacion</h2>
</div>
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<!-- 16:9 aspect ratio -->
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/watch?v=H0uvGe0AhNI"></iframe>
</div>
</div><!-- .col -->
</div><!-- row -->
</div><!-- .container -->
</section>
<!-- END PROMOTIONAL VIDEO -->
In your code src attr is wrong for IFRAME embed.
You need like this.
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/PIh2xe4jnpk"></iframe>
You have entered wrong input url...
try this....
<!-- 16:9 aspect ratio -->
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/PIh2xe4jnpk"></iframe>
</div>
<!-- 4:3 aspect ratio -->
<div class="embed-responsive embed-responsive-4by3">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/PIh2xe4jnpk"></iframe>
</div>
you just have to change the url by your hand .. just remove that part (/watch?v=)from the url and put(/embed/)instate
On this page an embedded YouTube video is displayed to the left of a carousel titled "Similar Festivals". The HTML used to embed the YouTube video is:
The HTML of the YouTube section is:
<div class="span4 spacer youtube">
<div class="title clearfix">
<h2 class="pull-left">YouTube</h2>
</div>
<iframe width="1000" height="1000" src="http://www.youtube.com/embed/NI8rQEHoE24"></iframe>
</div>
The layout of the page (using a responsive Bootstrap grid) is such that the video should have the same height as the carousel to the right of it, but as you can see, it is somehow breaking out of its parent container. I want the video to be aligned with the carousel to its right, how can I fix this.
Here's a screenshot in case there's any doubt about what I'm referring to!
I've noticed that row-fluid container is dynamically adding a width of 33% to your Youtube video. So whatever width expectation you set to it is being reset by that class.
Try this:
<div class="row-fluid">
<div class="span4 spacer twitter">
</div>
<!-- Youtube -->
<div class="span4 spacer youtube">
<div class="title clearfix">
<h2 class="pull-left">YouTube</h2>
</div>
<iframe height="150px" src="http://www.youtube.com/embed/NI8rQEHoE24"></iframe>
</div>
<!-- Similar Carousel -->
<div class="span4 spacer">
<div id="similarCarousel" class="carousel slide last">
</div>
</div>
</div>
(hat tip to Mr. Alien)
It sets the iframe height only. The whole row-fluid container expands somewhat, and the height is irregular. However, you don't have the 'jumping outta the container' problem.
Instead of
<iframe id="fitvid811516"
src="Festivals.ie%20_%20Electric%20Picnic%202012_files/NI8rQEHoE24.htm">
</iframe>
Use this
<iframe width="640" height="360"
src="http://www.youtube.com/embed/NI8rQEHoE24?feature=player_detailpage"
frameborder="0" allowfullscreen>
</iframe>
And adjust width and height manually. Iframes don't go along well with dynamic sizing.
Also if you don't want to break the layout but also don't want to change the content within, you can also go to the parent container in HTML and set overflow: hidden
.fluid-width-video-wrapper {
overflow:hidden;
}
Note that this would fix your layout but break the iframe; its bottom parts where play controls stay would be hidden.