I recently had a problem come up in where I was editing a stylesheet that had a checkout page with a table. In the table there was an image.
I couldn't get the image to center, and it was clinging to the bottom of the cel, so in the end as a workaround I used "margin-top:-25px;". I tried a couple tutorials on using absolute positioning of a cels content within a parent that has relative positioning but couldn't get it to work.
For now, this works, but I didn't even know until now that you could use negative numbers. I feel like it's bad practice, but even if it is, would there be a time in where it's necessary to use it?
Negative margins or shifting positioned elements with negative offsets may be indicative of something being amiss. If used for a planned on purpose, it's certainly OK. If it's an attempt to fix something that's not working as expected, make a minimal test case to discover where the issues lies. A few times digging to the bottom of an issue, and you'll find you begin to fix problems before they arise.
So, short answer? Maybe.
In today's problem, we'd need to see the markup for the element and its context plus the css. Do remember that tables are a special case container that have specific properties in support of the needs of a tabular structure. Are you using a table structure properly?
Thanks Gary, I am using
I am using tables, and I'm having a hard time wrapping my head around the basics of tables in CSS. I'm going to continue tomorrow by looking up some tutorials, guides and articles with tips to aid me in my study and I'll post up the site that I'm working with.
Maybe you can show us what
Maybe you can show us what you're working with?