{"id":1694,"date":"2010-11-15T10:24:58","date_gmt":"2010-11-15T10:24:58","guid":{"rendered":"http:\/\/mts-help.nick.php.dev\/after_sale_support\/working_with_html\/Advanced\/article9.html"},"modified":"2011-03-23T03:52:43","modified_gmt":"2011-03-23T07:52:43","slug":"how-add-multiple-link-styles-the-same-page","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/how-add-multiple-link-styles-the-same-page.html","title":{"rendered":"How to add multiple link styles on the same page"},"content":{"rendered":"<span class=\"question\">Q:<\/span> <span class=\"question_text\">How to add multiple link styles on the same page?<\/span>\r\n\r\n<span class=\"answer\">A:<\/span> We can define a link style that is only active in a certain area of the page by using context dependent selectors.\r\nRather than addressing the A: link selector, we will define an outer area that is separate from the area where we&#8217;d like our link style to be effective. <span class=\"answer_text\">\r\nFor example: <\/span>\r\n<div class=\"example_code\">&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;style type=&#8221;text\/css&#8221;&gt;\r\n.body A:link {color: #ff6600; text-decoration: none}\r\n.body A:visited {color: #0000ff; text-decoration: none}\r\n.body A:active {color: #0000CC; text-decoration: none}\r\n.body A:hover {color: #6699cc ; text-decoration: underline; color: red;}\r\n\r\n.body2 A:link {color: #0000CC; text-decoration: underline overline}\r\n.body2 A:visited {color: #0000CC; text-decoration: underline overline}\r\n.body2 A:active {color: #0000CC; text-decoration: underline overline}\r\n.body2 A:hover {color: #0000CC; text-decoration: underline; color: green;}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\nONE TYPE OF LINKS\r\n&lt;br\/&gt;\r\n&lt;span class=&#8221;body&#8221;&gt;\r\n&lt;a href=&#8221;http:\/\/www.yahoo.com&#8221;&gt;YAHOO&lt;\/a&gt;\r\n&lt;br\/&gt;\r\n&lt;a href=&#8221;http:\/\/www.google.com&#8221;&gt;GOOGLE&lt;\/a&gt;\r\n&lt;\/span&gt;\r\n&lt;br\/&gt;\r\n&lt;br\/&gt;\r\nANOTHER TYPE OF LINKS\r\n&lt;br\/&gt;\r\n&lt;span class=&#8221;body2&#8243;&gt;\r\n&lt;a href=&#8221;http:\/\/www.yahoo.com&#8221;&gt;YAHOO&lt;\/a&gt;\r\n&lt;br\/&gt;\r\n&lt;a href=&#8221;http:\/\/www.google.com&#8221;&gt;GOOGLE&lt;\/a&gt;\r\n&lt;\/span&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n\r\n<\/div>\r\nNote how we use the &lt;span&gt; to define the context.\r\nThis is smart for two reasons:\r\n<ul>\r\n\t<li>\r\n<ul>\r\n\t<li>It allows us to use different link styles on the same page, rather than being limited to using a single overall link style.<\/li>\r\n\t<li>We can define entire areas where a certain link style is applied. Thus, we don&#8217;t have to add a style definition to each and every link in that area.<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Q: How to add multiple link styles on the same page? A: We can define a link style that is only active in a certain area of the page by using context dependent selectors. Rather than addressing the A: link selector, we will define an outer area that is separate from the area where we&#8217;d [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[256],"tags":[514,2411,517],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/1694"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=1694"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/1694\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=1694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=1694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=1694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}