February 1, 201313 yr Hi I know the basic css but I'm currently stuck. I'm working on a website for my partners boss. I was working in html until i validated it and found out most of the html is outdated and told me to use css instead so i did. I managed to change most of it correctly until something happened. I have uploaded a picture. My button background is now too large and i can't seem to get it thinner. ideally i need it half that size. This is the code i have so far. <TABLE STYLE="width:100%" ALIGN="CENTER" CLASS="padded-table space"> <TD ALIGN="center" CLASS="colorbox"><P><B><FONT COLOR="FFFFFF">BUTTON</FONT></B></P></TD> </TABLE> I know the align is outdated to but I'm still working on that but if anyone wants to point me in the right direction i would really appreciate that. Thanks for any help.
February 1, 201313 yr Hi Flowdy, Ill be brutaly honest, you would be best in the long run to go back to the start and code without using tables. Adding CSS style to tables will always cause you problems as they only acept a limited amount of CSS coding. The best solution is to create Divs and assign the CSS to them, you will have a lot more freedom when desigingn if you msater coding using Divs with CSS. check out the 1stoptutorials website, there is a full video series on how to code a CSS website from scratch. Hope this helps.
February 1, 201313 yr Author Thanks DigitalYak i really appreciate your response. I guess to make is simpler for me i will start over. I will check that website out that you suggested. I just realized on a side note your from Newcastle Upon Tyne, My home town, Helped by a fellow Geordie is always nice
February 2, 201313 yr Here is what you could do to fix your problem (and use divs instead of tables):HTML: <div class="button"> <p>Button #1</p> </div> <div class="button"> <p>Button #2</p> </div> <div class="button"> <p>Button #3</p> </div> <div class="button"> <p>More Buttons</p> </div> And the CSS: div.button { display: block; width: 200px; margin-left: auto; margin-right: auto; background-color: #09F; } div.button p { color: #FFF; text-align: center; padding: 10px; margin-bottom: 3px; margin-top: 3px; font-family: Tahoma, Geneva, sans-serif; } I should also note, right now your using a class="padded-table space". I just want to double check that you know that is specifying two different classes, "padded-table" and "space". Edited February 2, 201313 yr by wellerweb
February 2, 201313 yr Here is what you could do to fix your problem (and use divs instead of tables): HTML: <div class="button"> <p>Button #1</p> </div> <div class="button"> <p>Button #2</p> </div> <div class="button"> <p>Button #3</p> </div> <div class="button"> <p>More Buttons</p> </div> And the CSS: div.button { display: block; width: 200px; margin-left: auto; margin-right: auto; background-color: #09F; } div.button p { color: #FFF; text-align: center; padding: 10px; margin-bottom: 3px; margin-top: 3px; font-family: Tahoma, Geneva, sans-serif; } I should also note, right now your using a class="padded-table space". I just want to double check that you know that is specifying two different classes, "padded-table" and "space". Hmmm, I'd have approached that one slightly differently: http://jsfiddle.net/Skateside/7RspB/
February 6, 201313 yr Author Thanks for the help and advice guys but i started again after learning more about html
Create an account or sign in to comment