My CSS code for table is overriding the bootstrap datepicker.It doesn't look anything like a calendar. How can i fix this?
I tried using css ":not" which unfortunately did not work.
I do not know what else to try.
I also tried to change them to classes and try which did not work as well.
Is there anyway to ignore the the css file for this element only or make bootstrap css !important?
Please check the demo with running code.
Thanks.
Codepen Demo
CSS Code of the table
/*Table*/
body{
background-color:black;
color:white;
}
table:not(.form-control) {
font-family: "Open Sans", sans-serif;
border: 1px solid salmon;
border-collapse: collapse;
margin: 0;
padding: 0;
width: 100%;
table-layout: fixed;
}
table caption {
font-size: 1.5em;
margin: .5em 0 .75em;
}
table tr:not(.form-control) {
background-color: #0B0C10;
border: 1px solid #0B0C10;
padding: .35em;
}
table th:not(.datepicker),
table td:not(.datepicker) {
padding: .625em;
text-align: center;
}
table th:not(.datepicker-days) {
font-size: .85em;
letter-spacing: .1em;
text-transform: uppercase;
}
#media screen and (max-width: 600px) {
table {
border: 0;
}
table caption {
font-size: 1.3em;
}
table thead {
border: none;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
table tr {
border-bottom: 3px solid salmon;
display: block;
margin-bottom: .625em;
}
table td {
border-bottom: 1px solid salmon;
display: block;
font-size: .8em;
text-align: right;
}
table td::before {
content: attr(data-label);
float: left;
font-weight: bold;
text-transform: uppercase;
}
table td:last-child {
border-bottom: 0;
}
}
Codepen Demo
Please take a look at this fork of your Codepen demo: https://codepen.io/kshetline/pen/mdbjyQr
You already had a class table-align that was wrapped around your table, so all that was necessary was to prefix the CSS rules which were meant to apply only to your table with .table-align. For example:
.table-align table th,
.table-align table td {
padding: .625em;
text-align: center;
}
.table-align table th {
font-size: .85em;
letter-spacing: .1em;
text-transform: uppercase;
}
And I also deleted all of the :not(.datepicker) stuff.
Related
Table {
font-family: Arial;
background-color: #EEEEEE.
border-collapse: collapse;
width: 100%;
}
Table td, Table th {
border: 1px solid #ddd;
padding: 1px 3px;
}
Table th {
font-size: 12px;
font-weight: bold;
padding-top: 10px;
padding-bottom: 10px;
text-align: left;
background-color: #1C6EA4;
color: white;
}
Table tr td:nth-child(1) {
color: #ff0000;
}
But E-mail i receive never shows the color i input. i already checked that it worked when i input the code on Web-based HTML CSS try editor.
What is the problem of below CSS code?
I've been reading non-stop about sizing and I still cannot seem to apply it to my code. I figured out that padding was causing my HTML table to overflow, but that it can be stopped with box-sizing: border-box;
So I added border-box to the elements I thought needed it, then to everything, trying to change width settings, but to no avail. When I remove border-box my header and navbar are affected, but the html table overflows the screen no matter what.
All my elements seem to fit on the screen perfectly fine, except the table. I assume that it is something I added that it countering the box sizing, but I commented out lines one by one and didn't find anything.
I put the full code into fiddle: https://jsfiddle.net/atpzw32L/
The CSS in question:
html, body, h1 {
margin: 0;
padding: 0;
}
html, body { min-height: 100%; }
body{
background-image: url("agaricus.png");
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
font-size: 100%;
padding: 20px;
box-sizing: border-box;
font-family: Arial, Helvetica, sans-serif;
margin: 0;
width: 100%;
}
/* Style the header */
.header {
padding: 10px;
text-align: center;
background: #832bfd7c;
color: white;
}
/* Increase the font size of the h1 element */
.header h1 {
font-size: 40px;
}
/* Style the top navigation bar */
.navbar {
overflow: hidden;
background-color: #333;
margin-bottom: 20px;
}
/* Style the navigation bar links */
.navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 14px 20px;
text-decoration: none;
}
/* Right-aligned link */
.navbar a.right {
float: right;
}
/* Change color on hover */
.navbar a:hover {
background-color: #ddd;
color: black;
}
/* CSS to hide key columns */
th:nth-child(4), th:nth-child(5), th:nth-child(6), th:nth-child(8), th:nth-child(11), th:nth-child(12), th:nth-child(13), th:nth-child(15) {
display: none
}
td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(8), td:nth-child(11), td:nth-child(12), td:nth-child(13), td:nth-child(15) {
display: none
}
/* CSS for checkboxes*/
.dropdown-check-list {
display: inline-block;
position: relative;
font-family: Verdana, sans-serif;
padding: 5px;
margin-top: 10px;
background-color: rgb(255, 255, 255);
}
.dropdown-check-list .anchor {
position: relative;
cursor: pointer;
display: inline-block;
padding: 5px 50px 5px 10px;
border: 1px solid #ccc;
min-width: 100px;
}
.dropdown-check-list .anchor:after {
position: absolute;
content: "";
border-left: 2px solid black;
border-top: 2px solid black;
padding: 5px;
right: 10px;
top: 20%;
-moz-transform: rotate(-135deg);
-ms-transform: rotate(-135deg);
-o-transform: rotate(-135deg);
-webkit-transform: rotate(-135deg);
transform: rotate(-135deg);
}
.dropdown-check-list .anchor:active:after {
right: 8px;
top: 21%;
}
.dropdown-check-list ul.items {
padding: 5px;
display: none;
margin: none;
border: 1px solid #ccc;
border-top: none;
position: absolute;
background-color: #f1f1f1;
}
.dropdown-check-list ul.items li {
list-style: none;
padding: 5px;
}
.dropdown-check-list.visible .anchor {
color: #0094ff;
}
.dropdown-check-list.visible .items {
display: block;
}
input {
float: right;
height: 18px;
width: 18px;
}
/* CSS for table */
table, th, td {
border: 2px solid;
box-sizing: border-box;
}
table {
border-collapse: collapse;
margin-top: 30px;
font-family: Verdana, sans-serif;
padding: 15px;
background-color: rgb(255, 255, 255);
}
th{
text-align: center;
height: 80px;
vertical-align: bottom;
padding: 2px;
border-bottom: 4px solid rgb(0, 0, 0);
font-size: 16px;
background-color: rgba(4, 100, 156, 0.278);
}
td {
text-align: center;
height: 100px;
width: 90%;
padding: 15px;
}
/* th{
text-align: center;
height: 100px;
vertical-align: bottom;
padding: 15px;
border-bottom: 4px solid rgb(0, 0, 0);
font-size: 16px;
background-color: rgba(4, 100, 156, 0.278);
} */
/*
td{
text-align: center;
height: 100px;
vertical-align: left;
padding: 15px;
font-size: 15px;
} */
tr:hover {background-color: rgba(4, 100, 156, 0.089);}
I aim for my end result to have all columns visible, and the table fitting within the screen, so when I add padding to the table it will fit within the screen. I would also like to keep the padding within th and td.
Please let me know how to go about this, I am out of ideas. Thank you
Concerning the width and the horizontal overflow of your table, this is simply caused by its contents: The cells (for example the header cells) contain (single) words that stretch the width of those cells (and therefore the columns) to fit into them, and so the overall width of the table becomes as wide as it is. Examples are the words "description", "information" and "identification" in the header cells.
Words won't be divided automatically, so those wordlenghts determine your minimum widths, expanding the column width and therefore the overall width of the table.
There are three methods to change that:
1.) (IMO the best) Use a smaller font size for the text. That way those longer words and with them the cells and columns won't be that wide and (maybe) fit into the screen.
2.) (also okay) Use hyphenation: Apply hyphens: auto; to td and th. The automatic hyphenation will divide words at know possible hyphenation positions.
3.) (IMO a bad solution) Apply word-break: break-word; to the cells. This will divide longer words, but at "incorrect" positions, i.e. simply at the end of the given cell width. As I wrote, not good, only to be used if nothing else works.
I would combine methods #1 and #2.
I've got a grid that I am generating on a webpage, with a some styling attached to it. The header has a background image applied to it. When the header is ONE line deep, it looks fine. The second that the header spans two lines (with a line break) it looks like the attachment. I've tried fiddling with the height but I just can't get it to take.
<style>
.Grid {background-color: #fff; margin: 5px 0 10px 0; border: solid 1px #525252; border-collapse:collapse; font-family:Calibri; color: #474747;}
.Grid td {
padding: 2px;
border: solid 1px #c1c1c1; }
.Grid th {
padding : 4px 2px;
color: #000000;
background: #363670 url(images/grid-header.png) repeat-x top;
border-left: solid 1px #525252;
font-size: 0.9em;
}
.Grid .alt {
background: #fcfcfc url(images/grid-alt.png) repeat-x top; }
.Grid .pgr {background: #363670 url(images/grid-pgr.png) repeat-x top; }
.Grid .pgr table { margin: 3px 0; }
.Grid .pgr td { border-width: 0; padding: 0 6px; border-left: solid 1px #666; font-weight: bold; color: #fff; line-height: 12px; }
.Grid .pgr a { color: Gray; text-decoration: none; }
.Grid .pgr a:hover { color: #000; text-decoration: none; }
</style>
To the .Grid th try adding
background-size: auto 100%;
The first variable is width, which we want whatever the normal behavior is because it's already working, and the second is height and is saying use 100% of available height.
http://codepen.io/mochiii/full/NGMXpe/ i have this project my problem is that the border- radius of the buttons are not uniform how do i fix that. I already tried specifying order radius for individual buttons but does not work.
#import url(https://fonts.googleapis.com/css?family=Audiowide);
#import url(https://fonts.googleapis.com/css?family=Righteous);
body{
background-color: #000000;
color: #ffffff;
}
.header{
font-family: 'Righteous', cursive;
}
h1{
border: 3px solid #ffffff;
border-radius: 20px;
width: 50%;
padding: 10px;
}
.countdown-block{
margin-top: 30px;
margin-bottom: 40px;
}
#clock{
border: 50px solid #FF1919;
border-radius: 60px;
padding: 20px;
width: 370px;
margin: 0px auto;
}
#clock>#countdown{
font-size: 60px;
font-family: 'Audiowide', cursive;
}
.breakHeader, .timeHeader{
font-family: 'Righteous', cursive;
}
#break, #time{
font-size: 40px;
font-family: 'Audiowide', cursive;
}
.btn{
font-size: 25px;
font-family: 'Righteous', cursive;
transition: all .3s;
position: absolute;
}
.btn:hover{
font-size: 35px;
}
.btn-group{
position: relative;
height: 35px;
display: block;
}
.btn-group > .btn{
float: none;
}
footer{
margin-top: 80px;
border-top: 2px dashed #ffffff;
}
i wonder what should i do thanks!
The problem is that you use Bootstrap and if you use .btn-group Bootstrap has predefined styles for that (you can see it HERE).
You can either override Bootstrap styles or create your own custom class and apply border-radius to it.
First solution:
CSS:
.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-radius: 10px;
}
.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 10px;
}
.btn-group>.btn:last-child:not(:first-child), .btn-group>.dropdown-toggle:not(:first-child) {
border-radius: 10px;
}
CODEPEN
Second solution:
HTML:
Add your-border-radius class to every button
<button class="btn btn-success your-border-radius" id="countdownStart">Start</button>
CSS:
.your-border-radius {
border-radius: 10px !important;
}
You have to use !important rule to override Bootstrap styles.
CODEPEN
The issue is with you implementation of bootstrap.min. There is a Button Group that removed border radius. What you can do is overwrite these classes by changing the order of the css class implementation. Then over write the classes for whatever you want.
.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
I have a header photo, and usually they are fairly easy to set up. However, for some reason which I cannot find, the header image floats over the elements of the HTML page.
Any help would be appreciated. I have tried looking for any margins/padding I forgot to delete, but there are none.
Picture of problem...
HTML pertaining to header image:
<div id="gallery">
<div id="imgContain">
<img src="pictures/clubhouse.jpg">
</div>
</div>
My CSS File: (not sure where the problem is, so I posted all of it...)
html, body
{
margin: 0;
padding: 0;
background-attachment: fixed;
background-image: url('.././pictures/04.jpg');
background-color: rgb(56,32,32);
}
#font-face
{
font-family: fancyFont;
src: url('fonts/fancy.otf');
}
#wrapper
{
min-width: 1000px;
margin: auto;
}
#content
{
background-color: white;
display: table;
border-radius: 5px;
bottom: 0px;
left: 0;
margin: auto;
right: 0;
top: 0;
width: 915px;
height: 100%;
box-shadow: 5px 5px 22px black;
}
#content p
{
padding: 25px;
font-family: Arial;
text-indent: 30px;
font-size: 1em;
word-wrap: break-word;
}
center
{
border-bottom: 1px solid black;
}
table
{
border: 1px solid black;
float: left;
}
.main-table /*Main table is the navigation table to the left...*/
{
background-color: white;
margin-bottom: 25px;
border: 4px double white;
width: 245px;
box-shadow: 0px 0px 10px black;
}
.main-table td
{
padding: 10px;
padding-left: 15px;
}
.main-table td a
{
text-decoration: none;
color: black;
font-family: Arial;
transition: .2s;
font-size: .9em;
padding-left: 20px;
}
.main-table td a:hover
{
border-bottom: 1px solid black;
color: black;
padding-left: 50px;
transition: .2s;
}
.main-table h1
{
font-family: fancyFont;
padding:10px;
color: black;
text-shadow: 2px 2px 1px white;
}
.division /*Division(s) are the small info boxes in the center.*/
{
margin-top: px;
margin-left: 40px;
border: none;
margin-bottom: 0px;
}
.division th
{
width: 250px;
background-color: white;
border-bottom: 3px double black;
padding: 10px;
font-family: fancyFont;
}
.division tr td
{
display: inline-block;
width: 250px;
height: 100px;
max-width: 250px;
}
#gallery
{
width: 100%;
height: 100px;
}
#gallery h1
{
font-family: fancyFont;
text-shadow: 2px 2px 1px #acacac;
}
#gallery img
{
width: 100%;
height: 450px;
border-bottom: 1px solid black;
}
table ul li
{
list-style: square;
font-family: Arial;
}
#imgContain
{
background-color: white;
width: 100%;
margin: 0;
padding: 0;
}
#table-container
{
width: 900px;
margin: 0;
}
take out the
#gallery{height:100px;}
css because your gallery img height is 450px and the two conflict.
An element will "float" over another element when the floating element's position is set to absolute. I don't see position: absolute; in your CSS, but I do see positioning styles (bottom: 0px; left: 0; etc.) so maybe another style sheet is applying position: absolute. Best way would be to inspect the elements using a browser inspector like Firefox has and see what CSS styles are being applied. You can send me the URL and I will look at it. If you just want to throw a dart at the board you could try setting this style:
#gallery {
position: static !important;
}
Floating generally happens when position: absolute is set in CSS, but strangely, it's not your case.
So, you can try to add a CSS property to this image, called z-index with the value of -1. It'll possibly work.
This property is a kind of "layers". By default, every element is set in z-index: 0.
So, basically, it'll be:
img {
z-index: -1;
}
or, in this case:
#gallery {
z-index: -1;
}
Sorry if my english is bad.