tchoy Posted November 21, 2009 Report Share Posted November 21, 2009 What am I doing wrong here? http://www.ohka.org/2008-Bowling-Night.html I have floated the jpg to the right, but it's not doing it. When you look at front page preview it looks like what I want. Quote Link to comment Share on other sites More sharing options...
PicnicTutorials Posted November 21, 2009 Report Share Posted November 21, 2009 syntax problem. It's img.jpg {} Quote Link to comment Share on other sites More sharing options...
tchoy Posted November 21, 2009 Author Report Share Posted November 21, 2009 then why does this work in the file - .cam img { float: right; margin: -15px 0 0 30px; } http://www.ohka.org/2009-Album.html also my pictures on the right do not line up http://www.ohka.org/2008-Bowling-Night.html Quote Link to comment Share on other sites More sharing options...
PicnicTutorials Posted November 21, 2009 Report Share Posted November 21, 2009 No thank you - no more. Quote Link to comment Share on other sites More sharing options...
virtual Posted November 21, 2009 Report Share Posted November 21, 2009 Because if you look carefully as Eric said at what you wrote for img.jpg you will see an extra ; which should not be there img.jpg{ float: right; margin: -40px; 0 0 0; } Quote Link to comment Share on other sites More sharing options...
Andrea Posted November 21, 2009 Report Share Posted November 21, 2009 You have some other issues - still the style that you have embedded in every page - when you decide to do it right and create your external stylesheet, which one are you going to pick? And if you plan on taking each stylesheet, turning it into its own css file, and linking each page to a different stylesheet, then you are totally missing the point of stylesheets. Also Back to 2008 Album Page >> This is wrong - you have to close your tags in the right order. And here, you need to get rid of the s. It's important to validate your code - had you done so, you'd have found the mistakes. Quote Link to comment Share on other sites More sharing options...
lm Posted November 21, 2009 Report Share Posted November 21, 2009 It's important to validate your code - had you done so, you'd have found the mistakes. take it as a general rule while coding: once you wrote the code, validate HTML (helps to correct mistakes like missing closing tags and Doctype relevance) and CSS. Quote Link to comment Share on other sites More sharing options...
Andrea Posted November 21, 2009 Report Share Posted November 21, 2009 And your pictures don't line up because you added a class to two of them that gives them a negative margin of 40. Get rid of that, then make the images smaller, so 2 float next to each other (this will happen automatically, once they have enough room), and adjust the margins to center them. Quote Link to comment Share on other sites More sharing options...
tchoy Posted November 21, 2009 Author Report Share Posted November 21, 2009 Because if you look carefully as Eric said at what you wrote for img.jpg you will see an extra ; which should not be there img.jpg{ float: right; margin: -40px; 0 0 0; } I'm just wondering why in one file it's .cam img and this one is img.jpg Quote Link to comment Share on other sites More sharing options...
Andrea Posted November 21, 2009 Report Share Posted November 21, 2009 You have this: img.jpg{ float: right; margin: -40px; 0 0 0; } See the extra ';' right after the -40px? That does not belong there and causes issues rendering the entire CSS. Quote Link to comment Share on other sites More sharing options...
virtual Posted November 21, 2009 Report Share Posted November 21, 2009 Tchoy wroteI'm just wondering why in one file it's .cam img and this one is img.jpg Didn't you write the code yourself? Do yourself a favour and make just one CSS stylesheet as Andrea told you, then validate the HTML and the CSS and then you will have an easier time (and so will we) correcting whatever other issues arise. Quote Link to comment Share on other sites More sharing options...
tchoy Posted November 21, 2009 Author Report Share Posted November 21, 2009 Tchoy wroteI'm just wondering why in one file it's .cam img and this one is img.jpg Didn't you write the code yourself? Do yourself a favour and make just one CSS stylesheet as Andrea told you, then validate the HTML and the CSS and then you will have an easier time (and so will we) correcting whatever other issues arise. In one file I had used .cam img and floated it to the right. I had used .jpg img and it did not float to the right, so someone told me to use img.jpg. So I'm wondering why there are two different ways to do this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.