W3C home > Mailing lists > Public > www-style@w3.org > July 1999

Re: moving text to left past margin

From: Håkon Wium Lie <howcome@operasoftware.com>
Date: Tue, 13 Jul 1999 17:09:05 +0200 (MET DST)
Message-Id: <199907131509.RAA25683@stovner.sys.sol.no>
To: Saku Ytti <saku@ytti.net>
Cc: www-style@w3.org
Also sprach Saku Ytti:

 > If I have margin defined and still would like to use whole available
 > space in somecases what should I do?
 > This didn't work:
 > .tight { margin-left: 0; margin-right: 0; }
 > What I actually need to accomplish is to fit large line from perl script.
 > And still have normal margin elsewhere.
 > It fells silly, but should I just drop the margin from BODY and put it
 > in UL for example, and when I want 0 margin text just close the UL?

You can to that, but it's cumbersome since you need to give all
elements a margin. An easier solution is to give your ".tight"
elements negative margin values, e.g.:

  .tight { margin-left: -30px; margin-right: -30px; }

Negativ margins should be used with care since there might be
implementations-specific limits. Hoever, most browser seem to support
them quite graciously. If you use percentage values, be aware that the
calcuations will be based on different containing blocks. Em units are
safer, px even more so.


Håkon Wium Lie             http://www.operasoftware.com/people/howcome
howcome@operasoftware.com                        gets you there faster
Received on Tuesday, 13 July 1999 11:09:38 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:50 UTC