I am studying web design and making a mock website at the moment, I am very new to bootstrap, css and html and am not sure where I am going wrong, I am starting to pull my hair out as have been working on this all morning and getting nowhere so I'm hoping you guys can help me. I have been trying to align the text portion of my div to the right of the videos. I have managed to get it over to the right but not up alongside it so it's all inside the background container. It looks to me as though it could be an issue with the columns as the video columns stretch right across and I wonder if they are preventing the last one from being able to move up. I hope this makes sense.
I have tried different display and float options and separating and blending rows but don't seem to be winning.
HTML Code and CSS below that:
<!--CONTAINER MAIN ABOUT INFO-->
<div class="page-header">
<h2>About Us</h2>
</div>
<div class="container container-about">
<!--VIDEOS-->
<div class="row videos">
<div class="col-md-4 vid1">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" width="560" height="315" src="https://www.youtube.com/embed/afRUIVxTGls" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<div class="col-md-4 vid2">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" width="560" height="315" src="https://www.youtube.com/embed/NNgRnJIjXM4" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<div class="col-md-8 about">
<p><strong>lorem epson etc</p>
</div>
</div>
</div>
<!--END OF MAIN ABOUT INFO-->
CSS
.videos {
display: inline;
}
.about {
float: right;
}
enter image description here
Bootstrap's grid system is based on a 12-column grid. If you want content to be side-by-side on the same row, the column classes need to add up to a number equal to (or less than) 12. Right now, in that row you have a 4, 4, and 8—which adds up to 16:
<div class="container">
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4"></div>
<div class="col-md-8"></div>
</div>
</div>
If you're going for a layout where the first two columns take up a quarter of the row, and the second takes up a half, use 3 + 3 + 6 = 12 instead:
<div class="container">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-3"></div>
<div class="col-md-6"></div>
</div>
</div>
(Also, don't forget to close that <strong> tag.)
Related
I would like to use an iFrame in the Content-DIV to avoid loading the navigation all the time.
Is it possible to include an iFrame there whichs is fullheight/fullwidth inside the second DIV?
<div style="position:fixed;width:190px;height:1500px;background:#951b24;float:left;z-index:1000;padding:25px>
Navigation
</div>
<div style="position:absolute;top:25px;left:265px;width:auto;height:auto">
Content
</div>
Did you mean that?
<div style="position:fixed;width:190px;height:1500px;background:#951b24;float:left;z-index:1000;padding:25px">
Navigation
</div>
<div style="position:absolute;top:25px;left:265px;width:calc(100% - 265px);height:100%;">
<iframe style="width: 100%; height: 100%;" src="https://www.youtube.com/embed/yfoY53QXEnI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
This is what i have, not sure why its not showing side by side. I've tried using float left, and tried using the bootstrap grid with no success. Thank you.
<div class="container">
<img src="placeholder" alt="picture of the band " width="500" height="300">
</div>
<div class="container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/placeholder" frameborder="0" allowfullscreen></iframe>
</div>
I just use this . It works.
.container{
float: left;
}
If you are using bootstrap replace container with any other class name and do float:left it works.
<style>
.classname{
float: left;
}
</style>
<div class="classname">
<img src="placeholder" alt="picture of the band " width="500" height="300">
</div>
<div class="classname">
<iframe width="560" height="315" src="https://www.youtube.com/embed/placeholder" frameborder="0" allowfullscreen></iframe>
</div>
They gave me this code
<iframe width="424" height="916" src="//invis.io/U5574OIA3" frameborder="0" allowfullscreen></iframe>
but I'm not sure how to actually embed it? I tried inserting that line to my website but nothing shows up.
I will provide more info if necessary. Thanks in advance
update:
<div class="container">
<div class="row project">
<div class="ten columns offset-by-one">
<h class="pageheadproject">Final Outcome</h>
<p class="divider">~</p>
<p class="subheadproject">User Scenario</p>
<p class="pagecontent2-first"> Sample Text </p>
<iframe width="424" height="916" src="//invis.io/U5574OIA3" frameborder="0" allowfullscreen></iframe>
</div>
</div>
I gave the iframe a border and now it looks like this
yes you should maybe precise the way you embed it in your website as it seems to work in this simple JSFIDDLE
<iframe width="424" height="916" src="//invis.io/U5574OIA3" frameborder="0" allowfullscreen></iframe>
OK So Im FINALIZING a clients website and Im using bootstrap 3 I have created this code for the website. It displays everything in the the first div and the second (middle) Div correctly but It doesnt display anything after that. I put it in a fluid container and It still doesnt display the last div nor any of the code that I have after this. I am using Notepad++ to edit and check my errors live and I dont see any error here? what could be the problem with this.
<div class="container-fluid" style="background-color: rgba (0,0,0,0.8)">
<div class="col-xs-2 col-sm-2 col-md-2">
<img src="../images/BluelinesandBigFaces.jpg" class="img-responsive"><br><button class="btn-warning" onmousedown="player1.loadPlaylist(0)">PLAY</button>
<img src="../images/pantiesdrop.jpg" class="img-responsive"><br><button class="btn-warning" onmousedown="player1.loadPlaylist(2)">PLAY</button>
<img src="../images/sidechick.jpg" class="img-responsive"><br><button class="btn-warning" onmousedown="player1.loadPlaylist(3)">PLAY</button>
</div>
<div class="col-xs-8 col-sm-8 col-md-8 embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/dWU4e6kFaaw"</iframe>
</div>
<div class="col-xs-2 col-sm-2 col-md-2">
<img src="../images/BluelinesandBigFaces.jpg" class="img-responsive"><br>
<img src="../images/BluelinesandBigFaces.jpg" class="img-responsive"><br>
<img src="../images/BluelinesandBigFaces.jpg" class="img-responsive">
</div>
</div>
<br>
<div class="row" style="background-color: rgba (0,0,0,0.8)">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- MusicPageAd -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-7512006871298343"
data-ad-slot="6094032318"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<br>
<div class="container-fluid" >
<div class="col-sm-10 col-md-10" style="background-color: rgba (0,0,0,0.8)">
<!--iFrameToVerticalPostPage-->
</div>
<div class="col-sm-2 col-md-2" style="background-color: rgba (0,0,0,0.8)">
Welcome Msg<br>
Twitter Feed<br>
Cost 2 Coast Side Ad
Facebook Feed<br>
ReAdvertisement<br>
</div>
</div>
Tag closing issue:
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/dWU4e6kFaaw"> // <-- close this
</iframe>
Always try to look at start and end tags - in any editor and even on code snippet above, if they're not the same color - there's something wrong!
I have been trying to embed a video into bootstrap website.
But when I do, it takes up the whole width and height of the screen. I want it to be 560px x 315px on desktops and it should be responsive when the desktop size goes below 560px.
I have used:
<div class="container-fluid">
<div class="embed-responsive embed-responsive-16by9 div_style">
<iframe class="embed-responsive-item" src="http://www.youtube.com/embed/XGSy3_Czz8k" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div>
</div>
When I try to customize div tag by adding div_style class max-width: 560px; and max-height:315px;, It changes video width to 560px but the height takes up the whole page height.
You missed to add col-xs-12 col-sm-6 col-md-4 col-lg-2. Something like this.
<div class="container-fluid">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-2 padding-zero embed-responsive embed-responsive-16by9">
<div id="foxnews">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/KFGbHBbXG_g?modestbranding=1&autohide=1&showinfo=0&rel=0" allowfullscreen="true"></iframe>
</div>
</div>
</div>
The bootstrap embed-responsive classes use padding-bottom to set the "height" of the element.
You can change this property along with width within a media query for your desired effect.
#media all and ( min-width: 560px ) {
.div_style {
width:560px;
padding-bottom:315px !important;
}
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<div class="container-fluid">
<div class="embed-responsive embed-responsive-16by9 div_style">
<iframe class="embed-responsive-item" src="http://www.youtube.com/embed/XGSy3_Czz8k" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div className="overlay"></div>
<div className='container-fluid vids col-md'>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-2 padding-zero embed-responsive embed-responsive-16by9">
<video playsInline="playsinline" autoPlay="autoplay" muted="muted" loop="loop">
<source src="videos/design.mp4" type="video/mp4"/>
</video>
</div>