javascript - Load another web page on click of a CSS box. CSS or js? -
i've got several css boxes on 1 of google sites pages wrap around js slider.
i'm wanting link page on site through click on box rather clicking on text within box.
i've done bit of research , haven't had luck. it's doable in css, javascript.
i've tried switching around tag outside breaks slider.
i've got snippet of code below:
style (css)
.box1 { background: ##ffd700; border-radius: 6px; cursor: pointer; height: 100px; line-height: 100px; text-align: center; transition-property: background; transition-duration: 1s; transition-timing-function: linear; width: 100px; position: relative; left: 0px; top: 0px; z-index:2; } .box1:hover { background: #990033; }
html
<div class="box1"><a href="https://www.google.co.uk" target = "_self"><font color = #ffffff>google</font></a></div>
i've created jsfiddle here: http://jsfiddle.net/tyh44dub/
would required add more javascript code or there possible way of doing through css?
note: i've got grand total of 8 boxes created.
i added jsfiddle. no need restructure html.
http://jsfiddle.net/tyh44dub/2/
.box1 a{ position:absolute; display:block; top:0px; bottom:0px; left:0px; right:0px; }
Comments
Post a Comment