Tell me more ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I want to change tweentyten style.css so that this:

#content img {
    margin: 0;
    height: auto;
    max-width: 640px;
    /*width: auto;*/
}

Will be the case (instead of the width being un-remarked)

I tried adding this to the file under the folder twentyten-child

But it didn't work.

Any more suggestions?

share|improve this question
2  
This should be on stackoverflow.com or more appropriately, doctype.com. – RandomBen Jul 28 '10 at 19:37
What we need, is this: area51.stackexchange.com/proposals/1500/wordpress-answers about a year ago! – artlung Jul 28 '10 at 20:13

closed as off topic by RandomBen, Tim Post, DisgruntledGoat, JasonBirch Jul 31 '10 at 4:53

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

2 Answers

To make a child theme, see Theme Development: Child Themes.

Probably all you need to do is create a new directory in your wp-content/themes/ directory. Call it my-twentyten/

Into it put a file called style.css with the following content:

/*
Theme Name: My Own Twenty Ten
*/

@import url("../twentyten/style.css");

#content img {
    margin: 0;
    height: auto;
    max-width: 640px;
    /*width: auto;*/
}
share|improve this answer
That's what I did and for some reason it didn't work. Maybe I missed something... – Tal Galili Jul 30 '10 at 15:06
I think it's possible that it did work, but the CSS you changed did not work as you expected. I would do something more drastic, perhaps add border: 10px solid #f00; as well, and see if that has an impact. – artlung Jul 31 '10 at 3:05

This question may end up being moved, but in the mean time:

Simply redefining the style rule with a portion left out, or commented out, will not cause that attribute (width, in this case) to return to default. It will be inherited from the existing rule, since it's not explicitly defined in your new rule.

In the new rule, you'll have to actually set width to the value you want.

But since width is set to 'auto', it seems a little strange that you'd just want to leave it out. Maybe you're trying to achieve some effect that I missed in your question.

share|improve this answer
Thanks. that is indeed my problem. I have images to get's fit into full width when the width is set to auto. And some images I have organized in a table in a post gets completely broken :( Where can I find what the style is using when I mark this line down. Meaning, what is it's default instead of auto for width? – Tal Galili Jul 30 '10 at 15:09
auto should be the default there. I'm curious if there is possibly a stray rule cascading into your images in that case, but I'm not sure I understand your example. Is it possible that you can share the website, or specific code that reproduces your problem? – anonymous coward Jul 30 '10 at 19:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.