PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.info.authoring.CSS > simulating Compliance box model in Quirks mode
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
simulating Compliance box model in Quirks mode

Réponse
 
LinkBack Outils de la discussion
Vieux 09/03/2008, 11h55   #1
Summercool
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut simulating Compliance box model in Quirks mode

Sometimes we are forced to use Quirks mode (such as embedding code in
other people's profile box, etc).

In that case, IE will show the box model by putting the "padding and
border" inside the width and height, while Firefox and Safari will put
it outside, the same as the CSS box model.

Now, to hack around it, there is these solutions:

http://webdesign.about.com/od/css/a/aaboxmodelhack.htm

what is known as Tan hack or is it the same as Tantek hack... and it
involves exploiting other bugs in the browser...

but I wonder, why don't we just declare 3 div's


<!-------------------- The code for Quirks mode -------------------->

<body style="background:yellow">

<div style="width:360px; height:360px; margin:0px; padding: 0px;
border: 0px">
<div style="padding:20px; border:10px solid black;backgroundrange">
<div style="height:300px;width:300px;margin:0pxadding :0px;
border:none;backgroundrange">

Hello World

</div>
</div>

</div>

</body>

<!--------------- The code for Standard Compliance mode ---------------
>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<body style="background:yellow">

<div style="width:300px; height:300px; margin:0px; padding: 20px;
border: 10px solid black;backgroundrange">

Hello World

</div>

</body>


So code #1 can simulate code #2, and it renders the same in IE and
Firefox's quirks mode, without having to exploit any bug in browsers.

and code #1, even if it is used in Standard Compliance mode, it would
still render the same, regardless of what mode it is in...


  Réponse avec citation
Vieux 10/03/2008, 00h59   #2
Bergamot
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: simulating Compliance box model in Quirks mode

Summercool wrote:
> Sometimes we are forced to use Quirks mode (such as embedding code in
> other people's profile box, etc).


I don't know what this profile box thing is, but why would that "force"
you to use quirks mode?

> Now, to hack around it, there is these solutions:
>
> http://webdesign.about.com/od/css/a/aaboxmodelhack.htm
>
> what is known as Tan hack or is it the same as Tantek hack...


This is A Bad Thing. Don't use it.

> but I wonder, why don't we just declare 3 div's


Why don't you just use a strict doctype and fix the messy code from the
profile box thing?

> <!--------------- The code


Post a URL, not code.

--
Berg
  Réponse avec citation
Vieux 15/03/2008, 08h05   #3
winterheat@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: simulating Compliance box model in Quirks mode

On Mar 9, 3:59 pm, Bergamot <berga...@visi.com> wrote:
> Summercool wrote:
> > Sometimes we are forced to use Quirks mode (such as embedding code in
> > other people's profile box, etc).

>
> I don't know what this profile box thing is, but why would that "force"
> you to use quirks mode?


the profile box is, such as in MySpace or Social Networking website,
if you develop an app, then you provide the code inside that
profile... they display it as an iframe, but they add the
<html><head> ... at the beginning of the code so your doctype never
get noticed by the browser.

i was thinking of using javascript document.compatMode =
"CSS1Compat"; except this property is only readable but not settable.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h52.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12120 seconds with 11 queries