3 replies [Last post]
markhansaven
markhansaven's picture
Offline
newbie
Last seen: 6 years 9 weeks ago
Timezone: GMT-4
Joined: 2014-06-02
Posts: 2
Points: 3

Hey there,

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?

Thanks,
Mark

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 22 hours 31 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9761
Points: 3843

± ∓

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. Tongue

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?

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

markhansaven
markhansaven's picture
Offline
newbie
Last seen: 6 years 9 weeks ago
Timezone: GMT-4
Joined: 2014-06-02
Posts: 2
Points: 3

Thanks Gary, I am using

Thanks Gary,

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.

Thanks again.

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 4 years 47 weeks ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2637
Points: 1556

Maybe you can show us what

Maybe you can show us what you're working with?