| 1. |
Solve : CSS Class not implementing? |
|
Answer» I am fairly new at using CSS and am having trouble with getting a class to work. In a table I have text areas and picture areas so I created two classes, td.text and td.pic. My problem is coming in getting them to work. My td. pic class is: inside the table. Try removing that or creating a new CSS rule for it. . I was under the impression that I need a tag before an tag. Also, if I use the code I was under the impression that I need a <p> tag before an <img> tag.NOPE, it just adds extra space around it. If you had, for example, 2 rows of images with 3 images in each row, then you might put the two rows in paragraphs so the pics won't be on top of each other. Quote from: toomuchespresso on October 26, 2010, 02:43:02 PM Also, if I use the codeOKAY.....try using an id instead of class. Code: [Select]<td id="pic">...</td> Code: [Select]td#pic { ... } Oh, and what browser are you using to view it?Ok. And lastly, do you have any good tricks to add a caption? Right now I have it set as Code: [Select]<img> <p>caption</p> Quote from: kpac on October 26, 2010, 02:48:02 PM Oh, and what browser are you using to view it? Firefox 3.6.10. Also doing pre-view in Amaya.Did that work? An example of captions would be like this: HTML Code: [Select]<table class="gallery"> <tr> <td> <div id="image"><img src="../image.jpg" /></div> <div id="caption">Image Caption</div> <td> <td> <div id="image"><img src="../image2.jpg" /></div> <div id="caption">Image Caption 2</div> <td> </tr> </table> CSS Code: [Select]table.gallery td { width: 500px; height: 600px; overflow: hidden; text-align: center; border: 1px solid #000; } td div#image { padding: 0; margin: 0; height: 570px; width: 500px; } td div#caption { padding: 5px; margin: 0; height: 20px; width: 490px; } That may need some tweaking. Quote from: toomuchespresso on October 26, 2010, 03:04:12 PM Firefox 3.6.10. Also doing pre-view in Amaya.Ok...I'm not sure why the class isn't working. Can you post or attach all the code in the file? (CSS+HTML) More info: http://www.elated.com/articles/styling-tables-with-css/What helped most was the reminder to view it in the browser (I was only looking at it in the writer software). Like I said, I'm new at this. Thanks for the help. Quote (I was only looking at it in the writer software)Yeah, sometimes those don't tend to be that accurate. You're better off checking it in the most popular browsers...IE, Firefox, Opera, Chrome and Safari. To do that there are websites such as https://browserlab.adobe.com/en-us/index.html (requires sign-in) and http://browsershots.org/. Obviously both require the site to be online somewhere. Quote Thanks for the help.No problem |
|