Copy link to clipboard
Copied
Looking for suggestions please.
After a very long break from Dreamweaver I am finding myself a little lost. Looking for an effective way to create a clean/blank interface with only two large buttons, both buttons/clickable areas to have:
What methods/approaches do you suggest I follow?
Thanks in advance.
See example below:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Unique Page Title</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
main {
display: flex;
flex-direction: row;
justify-content: space-around;
background-color: antiquewhite;
align-items: center;
min-height: 200px
}
div {
width: 100px;
height: 100px;
font-size: 33%;
text-align: center;
padding-top: 15%;
background: #CCC url(https://dummyim
...
Copy link to clipboard
Copied
Everything you want can be achieved very easily with CSS & HTML code. Keep in mind that hover or rollover triggers are meaningless to touch screen devices that don't use a mouse.
https://www.w3schools.com/css/css3_transitions.asp
Copy link to clipboard
Copied
See if this does what you want:
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
font-size: 33%;
background: #CCC url(https://dummyimage.com/100x100) no-repeat center center;
transition-property: width,height,font-size,background;
transition-duration: 2s;
transition-timing-function: linear;
}
div:hover {
width: 300px;
height:300px;
font-size:100%;
background: #CCC url(https://dummyimage.com/300x300) no-repeat center center;
}
</style>
</head>
<body>
<h1>CSS Transition Properties</h1>
<p>Hover over the div element below, to see the transition effect:</p>
<div><h1>Heading 1</h1>
<p>Lorem ipsum dolor...</p>
</div>
</body>
</html>
Copy link to clipboard
Copied
Thank you kindly @Nancy OShea. This is indeed a good launch point and, as always, so utterly obvious in retrospect. If I can bother you for one more fragment of information: I'm using Float Left on the div (plus a few other parameters), how do I go about having the full Div as an active hyperlink (of course without using Span, as two Divs – each with separate hyperlinks – need to appear adjacent to each other?)
Copy link to clipboard
Copied
We don't use floats much anymore. It's better to use CSS Flexbox:
https://www.w3schools.com/css/css3_flexbox.asp
Or CSS Grids:
https://www.w3schools.com/css/css_grid.asp
They pose fewer pain points than floats did with less code.
Copy link to clipboard
Copied
See example below:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Unique Page Title</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
main {
display: flex;
flex-direction: row;
justify-content: space-around;
background-color: antiquewhite;
align-items: center;
min-height: 200px
}
div {
width: 100px;
height: 100px;
font-size: 33%;
text-align: center;
padding-top: 15%;
background: #CCC url(https://dummyimage.com/100x100) no-repeat center center;
transition-property: width, height, font-size, background;
transition-duration: 1s;
transition-timing-function: linear;
}
div:hover {
width: 300px;
height: 300px;
font-size: 100%;
background: #CCC url(https://dummyimage.com/300x300) no-repeat center center;
}
a:link {
text-decoration: none;
color: darkred
}
a:hover, a:active, a:focus {
color: black;
text-decoration: underline;
}
</style>
</head>
<body>
<h1>CSS Flexbox & Transitions</h1>
<p>Hover over div elements below to see transitions:</p>
<main>
<a href="https://google.com">
<div>
<h1>Heading 1</h1>
<p>Lorem ipsum dolor...</p>
</div>
</a>
<a href="https://example.com">
<div>
<h1>Heading 1</h1>
<p>Lorem ipsum dolor...</p>
</div>
</a>
<a href="https://bing.com">
<div>
<h1>Heading 1</h1>
<p>Lorem ipsum dolor...</p>
</div>
</a>
</main>
</body>
</html>
Copy link to clipboard
Copied
Many thanks, this helps enormously!