Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Tuesday, March 22, 2016

Bootstrap makes overflow hidden automatically.

My Div

 <div class="form-group" >

contained a table far too wide. But instead of showing the horizontal scrollbar, the table was just brutally cut off and we couldn't see it.





Simple fix:

 <div class="form-group" style="overflow:scroll" >

Of course, later I decided to use an IFRAME and so it didn't matter anymore!

Friday, March 18, 2016


Code using Bootstrap to wrap text around a embedded video:







<div class="widget-content">
<h1 class="page-title">Welcome!</h1>
<div class="separator-2"></div>


<div class="row">
<div class="col-md-12">
                               
                                        <div class="pull-right" style="position:relative;padding-bottom:2%; padding-left:2%">

<div class="embed-responsive embed-responsive-16by9">
                                            <iframe width="420" height="315" src="https://www.youtube.com/embed/R-TBYP0xZCw" frameborder="0" allowfullscreen></iframe>

</div>
                                    </div>

                          
Blah blah blah blah.







</div>
</div>

Sunday, November 16, 2014

In HTML, the table styles cellpadding and cellspacing can be set
How would this be accomplished using CSS?

For controlling "cellpadding" in CSS, you can simply use padding on table cells. E.g. for 10px of "cellpadding":
td { 
    padding: 10px;
}
For "cellspacing", you can apply the border-spacing CSS property to your table. E.g. for 10px of "cellspacing":
table { 
    border-spacing: 10px;
    border-collapse: separate;
}
This property will even allow separate horizontal and vertical spacing, something you couldn't do with old-school "cellspacing".
Issues in IE <= 7
This will work in almost all popular browsers except for Internet Explorer up through Internet Explorer 7, where you're almost out of luck. I say "almost" because these browsers still support the border-collapse property, which merges the borders of adjoining table cells. If you're trying to eliminate cellspacing (that is, cellspacing="0") then border-collapse:collapse should have the same effect: no space between table cells. This support is buggy, though, as it does not override an existing cellspacing HTML attribute on the table element.
In short: for non-Internet Explorer 5-7 browsers, border-spacing handles you. For Internet Explorer, if your situation is just right (you want 0 cellspacing and your table doesn't have it defined already), you can use border-collapse:collapse.
table { 
    border-spacing: 0;
    border-collapse: collapse;
}
Note: For a great overview of CSS properties that one can apply to tables and for which browsers, see this fantastic Quirksmode page.

Credits: Eric Nguyen