- This topic is empty.
-
AuthorPosts
-
October 28, 2012 at 5:18 am #40496
Manojnaanak
Participantplease tell me anyone.
can we give padding in menus?
example:
{
padding-left:-15px;
}is this proper way or not???
thanx in advance
October 28, 2012 at 5:36 am #112805Paulie_D
MemberCertainly you can use padding in menus but there really isn’t any such thing as ‘negative’ padding.
You could use negative margins but there generally isn’t really a good reason to. Properly structured HTML and logical CSS will accomplish your design without using any odd ‘clever’ hacks.
October 28, 2012 at 7:57 am #112813Manojnaanak
Participantsometime in joomla and wordpress default template used our custm design
October 28, 2012 at 9:31 am #112815Senff
ParticipantNegative padding: absolute NO. Not valid, isn’t logical, makes no sense, etc.
Negative margin: generally not needed but there are situations where it’s really useful (I disagree with @Paulie_D — I definitely don’t think it’s a ‘hack’ to use negative margins).
October 28, 2012 at 12:25 pm #112824Taufik Nurrohman
ParticipantPeople create the ‘box out effect’ with a negative margin.
October 28, 2012 at 12:47 pm #112825Senff
ParticipantOf course somewhat outdated, but still a good article in defense of negative margins: http://coding.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/
October 28, 2012 at 1:34 pm #112832Paulie_D
MemberSorry…I didn’t mean to imply that one should never use negative margins….only that using them to ‘fix’ a problem is generally bad.
Using them to position an object because the design calls for it is, of course, entirely reasonable.
October 28, 2012 at 4:32 pm #112845Senff
Participant@PaulieD I wasn’t calling you out, sorry if it sounded like that! Just don’t think it qualifies as a ‘hack’. But it does have this stigma of “bad practice” anyway, so it’s all good. :)
May 12, 2014 at 6:41 am #169863jgodek
ParticipantThere is a case for negative padding. I want an border framed around a div. This border is a styled image to create a frame design around the div. I need the container div to appear to be inside the parent div so the parent divs border frames it. I can’t use negative margins since the container div is above the parent div in the DOM. So negative padding would be great here.
May 12, 2014 at 7:20 am #169870Paulie_D
MemberNegative padding here doesn’t sound like a solution, a extra div or
border-image
sounds like a better option.May 12, 2014 at 7:27 am #169873jgodek
ParticipantIt seems border image doesn’t frame a div it just creates a border around it.
I had this post made last week. It shows basically what Im tying to do.May 12, 2014 at 7:37 am #169876Paulie_D
MemberOK, but negative padding is NOT going to achieve that look..a proper border-image could but it would be somewhat inflexible as it would require an image with a background the same as your background color so it would blend in.
With a slider…it would probably be even worse.
May 12, 2014 at 7:41 am #169877jgodek
ParticipantYeah Im thinking to achieve this may not be worth the hassle.
Might b easier to do just add a frame to the images inside the slider. Thanks for your help.February 23, 2016 at 6:21 pm #238356kenmwebaze
ParticipantOkay, You are right. However, in cases where you inherit another designer’s style sheet, you may need a quick stitch and find the need to apply a negative margin especially if you wish to hide the already curved image edges whose write up you don’t wish to revisit.
I applied it my self in the line that follows;
.ptnx{ padding-left:15px; padding-right:15px; padding-bottom:0; padding-top:0px; margin-top:-1px; auto; color:#444; }October 17, 2017 at 4:10 pm #261454herculeandeveloper.com
Participantno, but you can use as margin….
{
margin-left:-100px;
} -
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.