?
Solved

Basic CSS question

Posted on 2013-01-17
5
Medium Priority
?
305 Views
Last Modified: 2013-01-17
I'm trying to customize a website template I purchased. It's got a lot of CSS already set and some of it I don't like. Unfortunately, it's hard to track down where some of the things are set. So, I want to be able to override what's in the .css files.

I want to create a style for a table. What I'm trying is not working.

In my file, I have...

      <style type="text/css">
                        table.stevetable {padding:30px; vertical-align:middle; border:thin;}
                        
                        </style>
                  
                  
                        <table border="1" cellpadding="6" cellspacing="0" width="100%" bordercolor="#000000" class="stevetable">


... but it's not working. What am I doing wrong? Thanks.
0
Comment
Question by:skbohler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 30

Accepted Solution

by:
LZ1 earned 2000 total points
ID: 38787728
You should start by removing the table attributes like bordercolor, border and width. Those can all be specified in CSS. You can leave the cellpadding and spacing if you want, but you can always set those in CSS too. Up to you really.

As far as the CSS not hitting the table, can you show a live link?
You should also be more specific in your CSS.  Don't just apply style to the entire table. Try hitting the tr and td to see if you get anything.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38787792
Yeah, we need the link. Template almost always make modification outside the limits that the author envisioned almost impossible.  A lot of them screw up the cascade with jquery and are almost impossible to work with unless you go into the scripting.

Cd&
0
 

Author Comment

by:skbohler
ID: 38787889
Hello,

Thanks for your replies. It's true that the effects I wanted were not there because I needed to apply them to the "td" and not whole table. Now I just need to figure the attribute to get a border around it.
0
 
LVL 30

Expert Comment

by:LZ1
ID: 38787902
A border around the table? or cell?

table:
table{border:1px solid #000000;}/*black*/

/*cell:*/
td{border:1px solid #3366ff;}/*blue*/

Open in new window

0
 

Author Comment

by:skbohler
ID: 38787938
Thanks.

I tried this and it seemed to work too:

            <style type="text/css">
                        table.stevetable td {padding:10px; vertical-align:middle; border-width:medium; border-style:solid; }
                        table.stevetable {border-color:#000000; border-width: 7px; border-style: solid; }
                        </style>
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question