Results 1 to 6 of 6

Thread: How CSS code can interfere each other?

  1. #1
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How CSS code can interfere each other?

    I use the CSS layout code from this site along with other CSS code. They interfere each other. When they are include in a JSP file as the following:

    <link rel="stylesheet" type="text/css" media="screen,projection" title="elements of form" href="<c:url value='/css/col2.css'/>"/>
    <link rel="stylesheet" type="text/css" media="screen,projection" title="elements" href="<c:url value='/css/blocks.css'/>"/>

    where the col2.css is the column CSS layout from this site.

    In the above situation, the layout CSS code works, but not the result. If I reverse the order of the link tags, the layout code doesn't work, but the result does.

    Any possible cause?

  2. #2
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    People here will probably want to see the code and the CSS files can you post it here or give links

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    wei, this is an issue of inheritance, hence "Cascading". If you have any other issues, please lemme know.

  4. #4
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by forum_amnesiac View Post
    People here will probably want to see the code and the CSS files can you post it here or give links
    That is the second set of CSS layout code I try with the same issue. I think that is not related with the CSS code itself, but something else. Now, the question is what is the "something else".
    The col2.css file which is from this site:
    PHP Code:
    #topsection{
    background#EAEAEA;
    height90px/*Height of top section*/
    }

    #topsection h1{
    margin0;
    padding-top15px;
    }

    #contentwrapper{
    floatleft;
    width100%;
    }

    #contentcolumn{
    margin-right200px/*Set right margin to RightColumnWidth*/
    }

    #rightcolumn{
    floatleft;
    width200px/*Width of right column in pixels*/
    margin-left: -200px/*Set left margin to -(RightColumnWidth) */
    background#FDE95E;
    }

    #footer{
    clearleft;
    width100%;
    backgroundblack;
    color#FFF;
    text-aligncenter;
    padding4px 0;
    }

    #footer a{
    color#FFFF80;
    }

    .
    innertube{
    margin10px/*Margins for inner DIV inside each column (to provide padding)*/
    margin-top0;

    And the block.css file: ...

  5. #5
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    And the block.css file:
    PHP Code:
    /******************************************************************************/
    #signup table {
     
    background-color#F9FBFD;
     
    color#000000;
     
    width400px;
     
    border1px solid #D7E5F2;
     
    border-collapsecollapse;
    }

    #signup td {
     
    border1px solid #D7E5F2;
     
    padding-left4px;
    }

    .
    labelcell {
     
    font11px VerdanaGenevaArialHelveticasans-serif;
     
    color#3670A7;
     
    background-colortransparent;
     
    width220px;
    }

    .
    fieldcell {
     
    background-color#F2F7FB;
     
    color#000000;
     
    margin-right0px;
     
    padding-right0px;
    }

    .
    smalllabelcell {
     
    font11px VerdanaGenevaArialHelveticasans-serif;
     
    background-colortransparent;
     
    color#3670A7;
     
    width100px;
    }

    .
    smallfieldcell {
     
    background-color#F2F7FB;
     
    color#000000;
     
    text-alignright;
     
    }

    .
    fieldcell input {
     
    width200px;
     
    font11px VerdanaGenevaArialHelveticasans-serif;
     
    background-color#D7E5F2;
     
    color#102132;
     
    border1px solid #284279;
     
    margin-right0px;
    }

    .
    smallfieldcell input {
     
    width100px;
     
    font11px VerdanaGenevaArialHelveticasans-serif;
     
    background-color#D7E5F2;
     
    color#102132;
     
    border1px solid #284279;
    }

    .
    fieldcell select {
     
    font11px VerdanaGenevaArialHelveticasans-serif;
     
    background-color#D7E5F2;
     
    color#102132;
     
    border1px solid #284279;
    }


    /* Design 5 */
    table.Design5 {
        
    border-spacing0px;
        
    border-collapsecollapse;
        
    border-top4px solid #284279;
        
    border-bottom1px solid #284279;
    }
    table.Design5 th {
        
    text-alignleft;
        
    font-weightnormal;
        
    padding0.2em 0.5em;
        
    border-top1px dotted #284279;
         
    colorBlack;
    }
    table.Design5 td {
          
    font11px VerdanaGenevaArialHelveticasans-serif;
        
    text-alignleft;
        
    border-top1px dotted #284279;
        
    padding0.2em 0.5em;
         
    colorBlack;
    }
    table.Design5 thead th {
          
    font11px VerdanaGenevaArialHelveticasans-serif;
        
    text-aligncenter;
        
    border-bottom1px solid #284279;
    }
    table.Design5 td.Corner {
        
    text-alignright;
    }
    table.Design5 td a {
     
    text-decorationnone;
    }

    #summary {
        
    padding0.5em;
        
    margin0 0 2em 0;
        
    background#F8F7EF;
        
    border-top1px dashed #B2B2B2;
        
    border-bottom1px dashed #B2B2B2;
    }
    #summary p {
        
    padding0
        
    margin1em;
    }
    #summary b {
        
    margin0 0.5em;
    }
    /* new item*/
    .item {border-bottom1px dashed #B2B2B2;}

    h3.title {
        
    margin1em 0 0;
        
    font-size1.5em;
        
    color#BBBBBB;
        
    }
        
    h3.title a
    {
        
    font-weightbold;
        
    color#336;
        
    text-decorationnone;
    }    

    h3.title a:hover
    {
        
    colorSilver;
        
    text-decorationnone;
    }

    h3.entry_title {
        
    margin1em 0 .5em;
        
    font-size1.5em;
        
    font-weightbold;
        
    color#336;
    }    

    h6.byline {
        
    margin0.25em 0 0.5em;
        
    font-size.8em;
        
    font-weightnormal;
        }

    h6.rightCorner {
        
    margin0.25em 0 0;
        
    font-size.8em;
        
    font-weightnormal;
        
    float:     right;
    }

    h6.rightCorner a {
        
    color#336;
        
    font-weightnormal;
        
    text-decorationnone;
    }

    h6.rightCorner a:hover
    {
        
    text-decorationunderline;
    }

    #comment{
        
    margin0 0;
        
    border-top1px dashed;
        
    border-bottom1px solid Black;
        
    padding2em 0 1px 2em;
    }    

    /******************************************************************************/
    /* used in the entry page*/
    #navigation {
     
    font-familyArialHelveticasans-serif;
     
    font-size.9em;
    }
    #navigation ul {
     
    list-stylenone;
     
    margin0;
     
    padding0;
     
    padding-top4px;
    }
    #navigation li {
     
    displayinline;
    }
    #navigation a:link, #navigation a:visited {  
     
    margin-right2px;
     
    padding3px 10px 2px 10px;  
     
    background-color#D7E5F2;
     
    text-decorationnone;
     
    border-top1px solid #FFFFFF;
     
    border-left1px solid #FFFFFF;
     
    border-bottom1px solid #717171;
     
    border-right1px solid #717171;
    }
    #navigation a:hover {
     
    border-top1px solid #717171;
     
    border-left1px solid #717171;
     
    border-bottom1px solid #FFFFFF;
     
    border-right1px solid #FFFFFF;
    }
    /* used in the entry page*/
    #navigation2 {
     
    font-familyArialHelveticasans-serif;
     
    font-size.9em;
    }
    #navigation2 ul {
     
    list-stylenone;
     
    margin0;
     
    padding0;
     
    padding-top4px;
    }
    #navigation2 li {
     
    displayinline;
    }
    #navigation2 a:link, #navigation2 a:visited {
        
    margin-right2px;
        
    padding3px 10px 2px 10px;
        
    background-colorSilver;
        
    text-decorationnone;
        
    border-top1px solid #FFFFFF;
        
    border-left1px solid #FFFFFF;
        
    border-bottom1px solid #717171;
        
    border-right1px solid #717171;
    }
    #navigation2 a:hover {
     
    border-top1px solid #717171;
     
    border-left1px solid #717171;
     
    border-bottom1px solid #FFFFFF;
     
    border-right1px solid #FFFFFF;
    }

    /*  Eric Meyer's Simple Separators */
     
    ul.simpleSeparators
    {
        
    padding-left0;
        
    margin-left0;
        
    border-bottom1px dotted #F60;
    }

    ul.simpleSeparators li
    {
        list-
    stylenone;
        
    margin0;
        
    padding0.25em;
        
    border-top1px dotted #F60;
        
    text-decorationnone;
    }

    ul.simpleSeparators li a
    {
     
    text-decorationnone;
     
    font-weightbold;
    color#000000;
    }

    ul.simpleSeparators li a:hover
    {
        
    text-decorationnone;
        
    font-weightlighter;
    }

    /* The holly Hack: Hides from IE5-Mac \*/
    html ul.simpleSeparators height1%}
    /* End hide from IE5 Mac*/

    /* used in category and city */
     
    .LeftBorderList
    {
    /* container div set-up */
    padding10px;
    font-size1em;
    /* Set font-size so theres no default */
    line-height22px;
    /* Set line-height because I think it looks better like this ;^) */
    letter-spacing.075em;
    /* Set letter-spacing so text don't jump as much when it turns bold on hover */
    }

    .
    LeftBorderList a
    {
    /* Set text-decoration and color so there is no default */
    text-decorationnone;
    color#000000;
    }

    .
    LeftBorderList a:hover
    {
    font-weightbold;
        
    letter-spacing.075em/* Set letter-spacing back to 0 so text don't jump as much when it turns to bold on hover (Still jumps some though) */
    }

    .
    LeftBorderList ul
    {
    list-
    style-typenone;
    padding-left0px;
    margin0px;
    }

    .
    LeftBorderList ul li
    {
    padding-left5px;
    margin-left2px;
    color#000000;
    /* Set margin-left to set-up the left border */
    }

    .
    LeftBorderList li 
    {
     
    border-left3px solid #BF9960; 
     
    }

    /* used in column title */

    h4.column {
        
    colorblack
        
    background-color#FFCC80;
        
    text-aligncenter;
    }

    h3.column {
        
    colorblack
        
    background-color#FFCC80;
        
    text-aligncenter;
    }

    /* rollover list used in the front page for new Ads */
    #rollover_container { width: 160px; }

    #rollover_container ul
    {
        
    margin-left0;
        
    padding-left0;
        list-
    style-typenone;
        
    font-familyArialHelveticasans-serif;
    }

    #rollover_container a
    {
    displayblock;
    padding3px;
    background-color#336;
    border-bottom1px solid #eee;
    }

    #rollover_container a:link, #rolloverlist a:visited
    {
    color#EEE;
    text-decorationnone;
    }

    #rollover_container a:hover
    {
    background-color#6078BF;
    color#fff;
    }

    html #rollover_container { height: 1%; } /* for IE/Win */
    *>html #rollover_container { he\ight: auto; } /* for IE5/Mac */

    /* form */

    .fieldset {
        
    width:300px; }
    .
    fieldset .label {
        
    text-align:right;
        
    width:70px;
        
    float:left;
        
    padding:0.2em;
        
    margin:0;
        
    margin-top:0.3em; }
    .
    fieldset .nobr {
        
    display:none; }  
    .
    fieldset .textfield {
        
    margin:3px;
        
    height:20px;
        
    width:200px; }
    .
    fieldset .textarea {
        
    margin:3px;
        
    height:165px;
        
    width:200px; }
        
     

    .
    button {
     
    font11px VerdanaGenevaArialHelveticasans-serif;
     
    background-color#D7E5F2;
     
    color#102132;
     
    margin-left12px;
     
    margin-top3px;
     
    margin-bottom2px;
    }    

    .
    indented {
     
    font11px VerdanaGenevaArialHelveticasans-serif;
      
    background-color#D7E5F2;
     
    background-colortransparent;
     
    displayblock;
     
    margin-right:0.5em;
     
    floatleft;
     
    width150px;
     
    text-align:right;
    }

    /* ?? */
    fieldset {
        
    border1px solid Navy;
        
    padding1em;
    }

    legend {
        
    padding0.2em 0.5em;
        
    border1px solid Navy;
        
    colorNavy;
        
    font-size90%;
        
    text-alignright;


  6. #6
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    con't
    PHP Code:
    /*  */
    form#general p {
       
    width35em;
       
    clearboth;
        
    margin1em;
    }

    form#general p label {
       
    displayinline;
       
    floatleft;
       
    width10em;
     
    font11px VerdanaGenevaArialHelveticasans-serif;
     
    margin-right:0.5em;
     
    text-align:left;    
    }

    form#general p input {
       
    displayinline;
       
    floatleft;
       
    width24em;
     
    font11px VerdanaGenevaArialHelveticasans-serif;
     
    text-align:left;    
    }

    form#general p input.text {
        
    border#26a solid 1px
    }

    form#general p button {
    margin-left25em;
    clearboth;
    color#000;
    background#D7E5F2;
    border2px #9cf outset
    }

    form#general p textarea {
       
    displayinline;
       
    floatleft;
       
    width24em;
        
    height10em;
     
    font11px VerdanaGenevaArialHelveticasans-serif;
     
    text-align:left;    }

    form#general fieldset {
        
    border1px solid Navy;
        
    padding1em;
    }

    form#general legend {
        
    padding0.2em 0.5em;
        
    border1px solid Navy;
        
    colorNavy;
        
    font-size90%;
        
    text-alignright;
    }
    /* used in the entry page*/
    block {
        
    displayblock;
       
    floatleft;
     
    text-align:left;    
    }

    block label {
     
    background-colortransparent;
     
    displayblock;
     
    margin-right:0.5em;
     
    width150px;
    }

    /* page bottom list  */
     #site_navigation ul
    {
        
    margin.7em 0 .7em;
        
    padding0;
        list-
    style-typenone;
        
    font-size1em;
    }

    #site_navigation ul li { display: inline; }

    #site_navigation ul li a
    {
        
    text-decorationnone;
        
    padding0 .4em 0 .4em;
        
    color#000;
    }

    #site_navigation ul li a:hover, #site_navigation ul li a#current
    {
    color#CCCCCC;
    }

    /* previous & next buttons  */
     
    ul#previous_next
    {
        list-
    style-typenone;
        
    margin1em 0 1em;
        
    padding.5em 0;
        
    border-top1px solid #666;
        
    font-size.9em;
    }

    ul#previous_next li a
    {
        
    displayblock;
        
    width5em;
        
    color#000;
        
    background-color#DDDDDD;
        
    padding.2em 0;
        
    text-aligncenter;
        
    text-decorationnone;
    }

    ul#previous_next li a:hover
    {
    color#000;
    background-color#BBBBBB;
    }

    ul#previous_next .left { float: left; }
    ul#previous_next .right { float: right; }

    /* pre */
    pre#content{
        
    font-size100%;
    }
    /* */
    .pre {white-space:pre}
    .
    nowrap {white-space:nowrap}

    /* http://labs.silverorange.com/images/tabsupdate/tabs.css */

    #main {
        
    border1px solid #666;
        
    clearboth;
        
    background#FBFAF4;
        
    padding-top2em;
            
    min-width71.5em;
    }

    #contents {
        
    padding1.5em;
        
    backgroundWhite;
        
    min-height300px;
        
    border-top-color#CCC;
    }

    html #contents  {height: 1%;}
    *>html #contents  {he\ight: auto;}

    #header {
        
    positionrelative;
        
    width100%;
        
    height3em;
        
    width45em/* a width is required for Opera, older Mozilla browsers, and Konqueror browsers */
        
    min-width71.5em;
    }

    #header ul#primary {
        
    margin0;
        
    padding0;
        
    positionabsolute;
        
    bottom: -1px;
        
    width45em/* a width is required for Opera, older Mozilla browsers, and Konqueror browsers */
        
    min-width71.5em;
    }

    #header ul#primary li  {
        
    displayinline;
        list-
    stylenone;
    }

    #header ul#primary a,#header ul#primary span,#header ul#primary a.current {
        
    width8em;
        
    displayblock;
        
    floatleft;
        
    padding4px 0;
        
    margin1px 2px 0 0;
        
    text-aligncenter;
        
    font-familytahomaverdanasans-serif;
        
    font-size85%;
        
    text-decorationnone;
        
    color#333;
    }

    #header ul#primary span,#header ul#primary a.current,#header ul#primary a.current:hover {
        
    border1px solid #666;
        
    border-bottomnone;
        
    background#FBFAF4;
        
    padding-bottom6px;
        
    margin-top0;
    }

    #header ul#primary a {
        
    backgroundwhite;
        
    border1px solid #AAA;
        
    border-bottomnone;
    }

    #header ul#primary a:hover {
        
    margin-top0;
        
    border-color#666;
        
    background#FBFAF4;
        
    padding-bottom5px;
    }

    #header ul#secondary {
        
    positionabsolute;
        
    margin0;
        
    padding0;
        
    bottom: -1.4em;
        
    left1px;
        
    width50em/* a width is required for Opera, older Mozilla browsers, and Konqueror browsers */
    }

    #header ul#secondary li a,#header ul#secondary li span {
        
    widthauto;
        
    displayblock;
        
    floatleft;
        
    padding0 10px;
        
    margin0;
        
    text-alignjustify;
        
    bordernone;
        
    border-right1px dotted #AAA;
        
    backgroundnone;
    }

    #header ul#secondary li a {
        
    color#06C;
        
    text-decorationunderline;
    }

    #header ul#secondary li a:hover {
        
    color#333;
        
    backgroundtransparent;
        
    padding0 10px;
        
    bordernone;
        
    border-right1px dotted #AAA;
    }

    #header ul#secondary li a:active {
        
    color#000;
        
    backgroundtransparent;
    }

    #header ul#secondary li:last-child a { border: none; }

    /* */

    ul#navbar{
    list-stylenone;
    margin0;
    padding7px 0;
    border-bottom1px solid #CCC;
    font-weightbold;
    text-aligncenter;
    white-spacenowrap;
    font18px GeorgiaTimesserif
    overflowhidden;
    min-width750px;
    background#FBFAF4;
    border-top1px solid #333;
    }
    ul#navbar li{
    displayinline;
    margin0 .3em
    }
    ul#navbar a{
        
    text-decorationnone;
        
    padding0 0 3px;
        
    border-bottom4px solid #FBFAF4;
        
    color#666;
        
    text-transformuppercase;
    }
    ul#navbar a#active{
    border-color#F60;
    color:#06F
    }
    ul#navbar a:hover{
    border-color#F60;
    color#999
    }

    /* */
    .vnav{
    width160px;
    padding0 0 1em 0;
    margin1em 0 1em;
    font-familyGeorgiaTimesserif;
    font-size1.2em
    font-weightbold;
    color#333;
    background#FBFAF4;
    }
    .
    vnav ul
    {
    list-
    stylenone;
    margin0;
    padding0;
    border1px solid #000;
    }
    .
    vnav li
    {
    border-bottom1px solid #fff;
    margin0;
    }
    .
    vnav li a
    {
    displayblock;
    padding5px 5px 5px 0.5em;
    border-left4px solid #FBFAF4;
    color#000;
    text-decorationnone;
    width100%;
    }
    html>body .vnav li a 
        
    widthauto;
        
    text-decorationnone;
    }
    .
    vnav ul a#current{
    border-color#F60;
    color:#06F;
    text-decorationnone;
    }
    .
    vnav li a:hover
    {
    border-left4px solid #F60;
    color#999;
    background-color#FFF;
    }
    /* */
    p.note {
        
    background#EEE;
        
    padding4px;
        
    font-familytahoma;
        
    font-size85%;
        
    line-height130%;
        
    margin-top0;
    }

    /* account bar */
    #account {
        
    margin.4em 2em 0 0;
        
    padding0 0 0 0;
        
    floatright;
        
    z-indexauto;
        
    font-size.9em;
    }

    #account a:link {
        
    text-decorationnone;
        
    colorBlack;
    }
    #account a:visited {
        
    text-decorationnone;
        
    colorBlack;
    }
    #account a:active {
        
    text-decorationnone;
        
    colorBlack;
    }
    #account a:hover {
        
    text-decorationnone
        
    colorBlack;
        
    font-weightbolder;

    I don't think it is an inheritance issue since two set of layout code with different class/id names lead to the same problem.
    Last edited by wei; 05-03-2009 at 04:47 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •