Advertisement
decembre

CSS - BORDERS + OUTLINES + RADIUS v.1

May 8th, 2016
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.54 KB | None | 0 0
  1. ============================BORDER ===============
  2. ============================
  3. ======== CSS - BORDERS + OUTLINES + RADIUS v.1 - POSTé
  4. ============================
  5.  
  6. BORDERS + OUTLINES
  7.  
  8.  
  9. ========================================
  10. ======== REMOVE DOTTED OUTLINE ON LINKS IN FIREFOX
  11. == http://snipplr.com/view/5026/
  12. a:active,
  13. a:focus {
  14. outline: 0;
  15. }
  16.  
  17. ========================================
  18. ======== REMOVE OUTLINE ON BUTTONS IN FIREFOX
  19. == http://snipplr.com/view/38859/
  20.  
  21. button::-moz-focus-inner { border: 0; }
  22.  
  23.  
  24. ========================================
  25. ======== REMOVE DOTTED FOCUS BORDER IN FIREFOX
  26. == http://snipplr.com/view/16931/
  27. button::-moz-focus-inner,
  28. input[type="reset"]::-moz-focus-inner,
  29. input[type="button"]::-moz-focus-inner,
  30. input[type="submit"]::-moz-focus-inner,
  31. input[type="file"] > input[type="button"]::-moz-focus-inner {
  32. border: none;
  33. }
  34.  
  35.  
  36.  
  37. ========================================
  38. ======== BORDER - Bordures en CSS
  39. ==http://css.mammouthland.net/border-css.php
  40. Fonctionne avec :(Presque) Tous les navigateurs graphiques
  41. Propriétés utilisées :
  42. border-width
  43. border-style
  44. border-color
  45. padding
  46.  
  47. border-style :
  48. dotted (pointillé)
  49. dashed (tirets)
  50. solid (solide)
  51. double (double)
  52. groove (rainurée)
  53. ridge (relief)
  54. inset (relief intérieur)
  55. outset (relief extérieur)
  56.  
  57. div {
  58. border-width: 1px 2px 3px 2px;
  59. border-style: solid dotted;
  60. border-color: black red;
  61. padding:0 10px;
  62. }
  63.  
  64. - Une seule bordure
  65. Si on veut se limiter à une seule bordure (par exemple pour "souligner" un titre),
  66. on pourra adopter la syntaxe suivante :
  67. h2 {
  68. border-bottom:1px dashed green;
  69. }
  70.  
  71.  
  72.  
  73. =========== BORDER - TABLE : border-spacing
  74. == http://www.w3schools.com/cssref/pr_border-spacing.asp
  75. Set the border-spacing for a table:
  76. - distance between the borders of adjacent cells (only for the "separated borders" model).
  77. EXAMPLE :
  78. table
  79. {
  80. border-collapse:separate;
  81. border-spacing:10px 50px;
  82. }
  83. ==
  84. table.ex1 {
  85. border-collapse: separate;
  86. border-spacing: 10px;
  87. }
  88.  
  89. table.ex2 {
  90. border-collapse: separate;
  91. border-spacing: 10px 80px;
  92. }
  93.  
  94. The border-spacing property sets the distance between the borders
  95. of adjacent cells (only for the "separated borders" model).
  96.  
  97. == length length Specifies the distance between the borders of adjacent cells in px, cm, etc.
  98. == Negative values are not allowed
  99.  
  100. If one length value is specified, it specifies both the horizontal and vertical spacing
  101. If two length values are specified, the first sets the horizontal spacing and the second sets the vertical spacing
  102.  
  103. inherit
  104. Specifies that the value of the border-spacing property
  105. should be inherited from the parent element
  106.  
  107. table.ex1
  108. {
  109. border-collapse:separate;
  110. border-spacing:10px;
  111. }
  112. table.ex2
  113. {
  114. border-collapse:separate;
  115. border-spacing:10px 50px;
  116. }
  117.  
  118. ============================
  119. =========== BORDER ELLIPTIQUE = 2 valeurs séparées par un slash (/) = 20px / 10px;
  120. == Créer des courbes elliptiques. (/) : border-radius: 20px / 10px;
  121. Il faut indiquer 2 valeurs séparées par un slash (/).
  122. border-radius: 20px / 10px;
  123.  
  124. ============================
  125. =========== -MOZ-OUTLINE-RADIUS
  126. In Mozilla applications like Firefox, the -moz-outline-radius CSS property can be used
  127. to give outlines rounded corners. An outline is a line that is drawn around elements,
  128. outside the border edge, to make the element stand out.
  129.  
  130. 2 single value applies to all 4 corners
  131. 2 values apply to :
  132. 1. topLeft and bottomRight and 2. to the topRight and bottomLeft corner
  133. 3 values apply to :
  134. 1. topLeft, 2. topRight and bottomLeft and 3. to the bottomRight corner
  135. 4 values apply to :
  136. 1. topLeft, 2. topRight, 3. bottomRight and 4. to the bottomLeft corner
  137.  
  138. EXAMPLE PERSO :
  139. .page-content ul {
  140. -moz-outline-radius: 12% 1em 25px 1em !important;
  141. outline: 1px solid red;
  142. }
  143. ============================
  144. =========== OUTLINE-COLOR : INVERT
  145. ==
  146. INVERT :
  147. FIREFOX Not supported Support had been dropped since 3.0 (1.9)
  148. outline-color: invert !important;
  149.  
  150. ============================
  151. =========== OUTLINE-OFFSET
  152. ==http://www.w3schools.com/cssref/css3_pr_outline-offset.asp
  153. The outline-offset property offsets an outline, and draws it beyond the border edge.
  154.  
  155. exemple:
  156. margin:20px;
  157. width:150px;
  158. padding:10px;
  159. height:70px;
  160. border:2px solid black;
  161. outline:2px solid red;
  162. outline-offset:10px;
  163.  
  164. exemple perso:
  165. border-radius: 3px !important;
  166. background-color: rgba(0, 0, 0, 0.7) !important;
  167. -moz-outline-radius: 3px !important;
  168. outline-offset: -3px !important;
  169. outline: 1px dotted gray !important;
  170. border: 2px solid #222222 !important;
  171. ============================
  172. =========== BORDER RADIUS
  173. sidebarheader
  174. {-moz-appearance: none !important;
  175. border-top: none !important;
  176. /*background-image: -moz-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)) !important; }*/5usbtnar@
  177.  
  178.  
  179. /* === ARRONdir box ===*/
  180. border-radius: 2px 2px 2px 2px;
  181. border-bottom-left-radius: 2px;
  182. border-top-left-radius: 2px;
  183.  
  184. .site_nav_menu_buttons li, #candy_search_button_bar li { {
  185. background-color: #222222 !important;
  186. border: 6px solid #222222 !important;
  187. border-radius: 10px 10px 10px 10px !important;
  188. color: #CCCCCC !important;
  189. }
  190.  
  191. border-radius: 20px 20px 20px 20px !important;
  192.  
  193.  
  194. ============================
  195. =========== border-radius: 50% draws a perfect circle - My theory on border-radius (depending on the size of the element):
  196. == http://tympanus.net/codrops/2012/10/23/basic-ready-to-use-css-styles/
  197. At 0px, you have sharp angles. True story.
  198. Between 1 and 4px, you have subtle rounded corners. Most people won’t be able to tell corners are rounded, but they won’t have the “sharp knife” impression.
  199. Between 5 and 10px, you have rounded corners. Not more, not less. Depending on the design, it can look very cheap, or absolutely lovely.
  200. After 10px, you have -in my opinion- ugly rounded corners. It looks like you’re trying to recreate the “we do because we can” thing from the past. Plus, as I said earlier, the trend isn’t much into round corners any more.
  201.  
  202. There are two values you should remember when you’re using the border-radius property:
  203.  
  204. border-radius: 50% draws a perfect circle as long as you’re dealing with a square.
  205. If it’s a rectangle, then you’ll turn it into an ellipse.
  206. In order to achieve icon-like border-radius, the perfect ratio is 6.4 .
  207. So if you have a 100*100px square and want to turn it into an icon, you should apply it 16px border-radius (100 / 6.4 = 15.625).
  208.  
  209. ============================
  210. ======== BORDER ARRONDIS - (border-radius)
  211. ==http://css.mammouthland.net/border-css.php
  212. div {
  213. padding:0 10px;
  214. border:3px double black;
  215. border-radius:10px;
  216. -moz-border-radius:10px;
  217. -webkit-border-radius:10px;
  218. }
  219.  
  220. ============================
  221. ======== BORDER ARRONDIS
  222. == http://www.siteduzero.com/tutoriel-3-561853-les-bordures-et-les-ombres.html
  223. On peut utiliser jusqu'à 3 valeurs pour modifier l'apparence de la bordure :
  224. La largeur : indiquez la largeur de votre bordure. Mettez une valeur en pixels (comme 2px).
  225. La couleur : c'est la couleur de votre bordure. Utilisez, comme on l'a appris, soit un nom de couleur ("black", "red"...), soit une valeur hexadécimale (#FF0000), soit une valeur rgb (rgb(198, 212, 37)).
  226. Le type de bordure : là, vous avez le choix. Votre bordure peut être un simple trait, ou des pointillés, ou encore des tirets etc... Voici les différentes valeurs disponibles :
  227. none : pas de bordure (par défaut)
  228. solid : un trait simple.
  229. dotted : pointillés.
  230. dashed : tirets.
  231. double : bordure double.
  232. groove : en relief.
  233. ridge : autre effet relief.
  234. inset : effet 3D enfoncé.
  235. outset : effet 3D surélevé.
  236. Bordures différentes en fonction du côté (haut, bas, gauche ou droite).
  237. Dans ce cas, vous devrez utiliser ces 4 propriétés :
  238. border-top : bordure en haut.
  239. border-bottom : bordure en bas.
  240. border-left : bordure à gauche.
  241. border-right : bordure à droite.
  242.  
  243. Il existe aussi des équivalents pour paramétrer chaque détail de la bordure
  244. si vous le désirez :
  245. border-top-width pour modifier l'épaisseur de la bordure du haut, border-top-color pour la couleur du haut, etc.
  246. Pour ajouter une bordure uniquement à gauche et à droite des paragraphes, on écrira donc :
  247. {
  248. border-left: 2px solid black;
  249. border-right: 2px solid black;
  250. }
  251. On peut modifier les bordures de n'importe quel type d'élément sur sa page.
  252. Nous l'avons fait ici sur les paragraphes, mais on peut aussi modifier la bordure de ses images,
  253. des textes importants comme <strong>, etc.
  254. === Bordures arrondies : border-radius en pixels :
  255. border-radius: 10px;
  256.  
  257. L'arrondi se voit notamment si l'élément a des bordures :
  258. On peut aussi préciser la forme de l'arrondi pour chaque coin.
  259. Dans ce cas, indiquez 4 valeurs :
  260. border-radius: 10px 5px 10px 5px;
  261. correspondant aux angles suivants dans cet ordre :
  262. En haut à gauche
  263. En haut à droite
  264. En bas à droite
  265. En bas à gauche
  266.  
  267.  
  268.  
  269. ============================
  270. ======== BORDER-RADIUS
  271. == https://developer.mozilla.org/en-US/docs/CSS/border-radius
  272. The radius applies to the whole background, even if the element has no border;
  273. the exact position of the clipping is defined by the background-clip property.
  274.  
  275. SYNTAX :
  276.  
  277. Formal syntax: [ <length> | <percentage> ]{1,4} [ / [ <length> | <percentage> ]{1,4} ]?
  278.  
  279. The syntax of the first radius allows one to four values:
  280. border-radius: radius
  281. border-radius: top-left-and-bottom-right top-right-and-bottom-left
  282. border-radius: top-left top-right-and-bottom-left bottom-right
  283. border-radius: top-left top-right bottom-right bottom-left
  284.  
  285. The syntax of the second radius also allows one to four values
  286. border-radius: (first radius values) / radius
  287. border-radius: (first radius values) / top-left-and-bottom-right top-right-and-bottom-left
  288. border-radius: (first radius values) / top-left top-right-and-bottom-left bottom-right
  289. border-radius: (first radius values) / top-left top-right bottom-right bottom-left
  290.  
  291. border-radius: inherit
  292.  
  293.  
  294. VALUES :
  295.  
  296. <length>
  297. Denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipsis.
  298. It can be expressed in any unit allowed by the CSS <length> data types. Negative values are invalid.
  299. <percentage>
  300. Denotes the size of the circle radius, or the semi-major and semi-minor axes of the ellipsis,
  301. using percentage values. Percentages for the horizontal axis refer to the width of the box,
  302. percentages for the vertical axis refer to the height of the box. Negative values are invalid.
  303.  
  304. FOR EXAMPLE:
  305.  
  306. border-radius: 1em/5em;
  307.  
  308. /* is equivalent to */
  309.  
  310. border-top-left-radius: 1em 5em;
  311. border-top-right-radius: 1em 5em;
  312. border-bottom-right-radius: 1em 5em;
  313. border-bottom-left-radius: 1em 5em;
  314.  
  315. border-radius: 4px 3px 6px / 2px 4px;
  316.  
  317. /* is equivalent to: */
  318.  
  319. border-top-left-radius: 4px 2px;
  320. border-top-right-radius: 3px 4px;
  321. border-bottom-right-radius: 6px 2px;
  322. border-bottom-left-radius: 3px 4px;
  323.  
  324.  
  325. EXAMPLES :
  326.  
  327. border: solid 10px;
  328. /* the border will curve into a 'D' */
  329. border-radius: 10px 40px 40px 10px;
  330.  
  331. border: groove 1em red;
  332. border-radius: 2em;
  333.  
  334. background: gold;
  335. border: ridge gold;
  336. border-radius: 13em/3em;
  337.  
  338. border: none;
  339. border-radius: 40px 10px;
  340.  
  341. border: none;
  342. border-radius: 50%;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement