Team:Kent/CSS

From 2014.igem.org

(Difference between revisions)
 
(180 intermediate revisions not shown)
Line 1: Line 1:
-
@charset "utf-8";
+
body {
-
/* Simple fluid media
+
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
-
  Note: Fluid media requires that you remove the media's height and width attributes from the HTML
+
background-image: url(https://static.igem.org/mediawiki/2014/0/00/Wiki-background-kent-uni-2014.jpg);
-
  http://www.alistapart.com/articles/fluid-images/  
+
margin: 0;
-
*/
+
padding: 0;
-
img, object, embed, video {
+
border-top-color: #FFF;
-
max-width: 100%;
+
border-right-color: #FFF;
-
}
+
border-bottom-color: #FFF;
-
/* IE 6 does not support max-width so default to width 100% */
+
border-left-color: #FFF;
-
.ie6 img {
+
 
-
width:100%;
+
}
}
-
/*
 
-
Dreamweaver Fluid Grid Properties
 
-
----------------------------------
 
-
dw-num-cols-mobile: 5;
 
-
dw-num-cols-tablet: 8;
 
-
dw-num-cols-desktop: 10;
 
-
dw-gutter-percentage: 25;
 
-
 
-
Inspiration from "Responsive Web Design" by Ethan Marcotte
 
-
http://www.alistapart.com/articles/responsive-web-design
 
-
 
-
and Golden Grid System by Joni Korpi
 
-
http://goldengridsystem.com/
 
-
*/
 
-
/* Mobile Layout: 480px and below. */
+
/* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */
-
.gridContainer {
+
.container {
-
margin-left: auto;
+
-
margin-right: auto;
+
-
width: 87.36%;
+
-
padding-left: 1.82%;
+
-
padding-right: 1.82%;
+
-
}
+
-
#LayoutDiv1 {
+
-
clear: both;
+
-
float: left;
+
-
margin-left: 0;
+
-
width: 100%;
+
-
display: block;
+
-
}
+
-
/* Tablet Layout: 481px to 768px. Inherits styles from: Mobile Layout. */
+
        width: 100%;
 +
max-width: 1260px;
-
@media only screen and (min-width: 481px) {
+
/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */
-
.gridContainer {
+
 
-
width: 90.675%;
+
min-width: 780px;  
-
padding-left: 1.1625%;
+
 
-
padding-right: 1.1625%;
+
/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */
-
}
+
 
-
#LayoutDiv1 {
+
background-color: #FFF;
-
clear: both;
+
        margin: 0 auto;
-
float: left;
+
 
-
margin-left: 0;
+
/* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */
-
width: 100%;
+
-
display: block;
+
text-align: right;
-
}
+
}
}
-
/* Desktop Layout: 769px to a max of 1232px.  Inherits styles from: Mobile Layout and Tablet Layout. */
+
/* ~~ the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo ~~ */
 +
 
 +
.header {
 +
        float:left;
 +
background-color: #6F7D94;
 +
position:absolute;
 +
width: auto;
 +
        top:0px;
-
@media only screen and (min-width: 769px) {
 
-
.gridContainer {
 
-
width: 100%;
 
-
max-width: 1080px;
 
-
padding-left: 0%;
 
-
padding-right: 0%;
 
-
margin: auto;
 
-
}
 
-
#LayoutDiv1 {
 
-
clear: both;
 
-
float: left;
 
-
margin-left: 0;
 
-
width: 100%;
 
-
display: block;
 
}
}
 +
/* ~~ These are the columns for the layout. ~~
 +
1) Padding is only placed on the top and/or bottom of the divs. The elements within these divs have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.
 +
2) No margin has been given to the columns since they are all floated. If you must add margin, avoid placing it on the side you're floating toward (for example: a right margin on a div set to float right). Many times, padding can be used instead. For divs where this rule must be broken, you should add a "display:inline" declaration to the div's rule to tame a bug where some versions of Internet Explorer double the margin.
-
#contentSub, #search-controls, .firstHeading, #footer-box, #catlinks, #p-logo {
+
3) Since classes can be used multiple times in a document (and an element can also have multiple classes applied), the columns have been assigned class names instead of IDs. For example, two sidebar divs could be stacked if necessary. These can very easily be changed to IDs if that's your preference, as long as you'll only be using them once per document.
-
    display:none;}
+
-
#top-section {
+
-
    border: none;
+
-
    height: 0px;}
+
-
#content {
+
-
    border: none;}
+
 +
4) If you prefer your nav on the right instead of the left, simply float these columns the opposite direction (all right instead of all left) and they'll render in reverse order. There's no need to move the divs around in the HTML source.
-
#menubar > ul > li:last-child {
+
*/
-
    display: none;}
+
.sidebar1 {
 +
float:left;
 +
width: auto;
 +
background-color: #FFFFFF;
 +
padding-bottom: 0px;
 +
position:absolute;
 +
        margin-top: -55px;
-
#menubar {
+
     
-
    width: auto;}
+
 
 +
}
 +
 
 +
.content {
 +
text-align:center;
 +
width: 960px;
 +
padding-top:0;
 +
padding-right: 0;
 +
padding-bottom: 0;
 +
padding-left: 0;
 +
margin-top:160px;
 +
 +
}
 +
 
 +
 
 +
 
 +
/* ~~ The footer ~~ */
 +
.footer {
 +
padding: 10px 0;
 +
background-color: #FFFFFF;
 +
position: relative;/* this gives IE6 hasLayout to properly clear */
 +
clear: both; /* this clear property forces the .container to understand where the columns end and contain them */
 +
}
 +
 
 +
/* ~~ miscellaneous float/clear classes ~~ */
 +
.fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
 +
float: right;
 +
margin-left: 8px;
 +
}
 +
.fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
 +
float: left;
 +
margin-right: 8px;
 +
}
 +
.clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */
 +
clear:both;
 +
height:0;
 +
font-size: 1px;
 +
line-height: 0px;
 +
}

Latest revision as of 16:48, 14 August 2014

body { font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif; background-image: url(Wiki-background-kent-uni-2014.jpg); margin: 0; padding: 0; border-top-color: #FFF; border-right-color: #FFF; border-bottom-color: #FFF; border-left-color: #FFF;

}


/* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */

.container {

        width: 100%;

max-width: 1260px;

/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */

min-width: 780px;

/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */

background-color: #FFF;

       margin: 0 auto;

/* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */

text-align: right; }

/* ~~ the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo ~~ */

.header {

       float:left;

background-color: #6F7D94; position:absolute; width: auto;

       top:0px;

}

/* ~~ These are the columns for the layout. ~~

1) Padding is only placed on the top and/or bottom of the divs. The elements within these divs have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.

2) No margin has been given to the columns since they are all floated. If you must add margin, avoid placing it on the side you're floating toward (for example: a right margin on a div set to float right). Many times, padding can be used instead. For divs where this rule must be broken, you should add a "display:inline" declaration to the div's rule to tame a bug where some versions of Internet Explorer double the margin.

3) Since classes can be used multiple times in a document (and an element can also have multiple classes applied), the columns have been assigned class names instead of IDs. For example, two sidebar divs could be stacked if necessary. These can very easily be changed to IDs if that's your preference, as long as you'll only be using them once per document.

4) If you prefer your nav on the right instead of the left, simply float these columns the opposite direction (all right instead of all left) and they'll render in reverse order. There's no need to move the divs around in the HTML source.

  • /

.sidebar1 { float:left; width: auto; background-color: #FFFFFF; padding-bottom: 0px; position:absolute;

       margin-top: -55px;


}

.content { text-align:center; width: 960px; padding-top:0; padding-right: 0; padding-bottom: 0; padding-left: 0; margin-top:160px;

}


/* ~~ The footer ~~ */ .footer { padding: 10px 0; background-color: #FFFFFF; position: relative;/* this gives IE6 hasLayout to properly clear */ clear: both; /* this clear property forces the .container to understand where the columns end and contain them */ }

/* ~~ miscellaneous float/clear classes ~~ */ .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */ float: right; margin-left: 8px; } .fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */ float: left; margin-right: 8px; } .clearfloat { /* this class can be placed on a
or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */ clear:both; height:0; font-size: 1px; line-height: 0px; }