SlideShare a Scribd company logo
Css 2
<!DOCTYPE html>
<html>
<head>
<style>
a {
color: red;
}
</style>
</head>
<body>
<p><b><a href="default.asp" target="_blank">This is a link</a></b></p>
</body>
</html>
προορισμος
Λεξη που θα
κανουμε κλικ
πανω της
Ετικετα
υπερσυνδεσμου
<!DOCTYPE html>
<html>
<head>
<style>
/* unvisited link */
a:link {
color: red;
text-decoration: none;
background-color: yellow;
}
/* mouse over link */
a:hover{
color: hotpink;
text-decoration: underline;
background-color: lightgreen;
}
/* selected link */
a:active {
color: blue;
}
</style>
</head>
<body>
<p><b><a href="default.asp" target="_blank">This is a link</a></b></p>
Όταν το ποντικι παει πανω
στο λινκ
Όταν το ποντικι κανει κλικ
πανω στο λινκ
<!DOCTYPE html>
<html>
<head>
<style>
a:link, a:visited {
background-color: green; χρώμα πλαισίου όταν δεν πηγαίνει το ποντίκι πάνω του
color: white;
padding: 34px 25px; Διαστάσεις πλαισίου
text-align: center;
text-decoration: none;
display: inline-block;
}
a:hover, a:active {
background-color: red; χρώμα πλαισίου όταν πηγαίνει το ποντίκι πάνω του
}
</style>
</head>
<body>
<a href="default.asp" target="_blank">This is a link</a>
</body>
</html>
14-2-γπ
• https://www.w3schools.com/css/css_link.asp
Navigation bar
<!DOCTYPE html>
<html>
<body>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
<p>Note: We use href="#" for test links. In a real web site this would
be URLs.</p>
</body>
</html>
let's remove the bullets and the
margins and padding from the list:
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<p>In this example, we remove the bullets from the list, and its default padding and margin.</p>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
ΒΓΑΖΩ ΤΙΣ ΚΟΥΚΚΙΔΕΣ ΑΠΌ
ΤΗΝ ΛΙΣΤΑ
Vertical Navigation Bar
To build a vertical navigation bar, you can style
the <a> elements inside the list, in addition to
the code above:
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
}
li a {
display: block;
width: 60px;
background-color: #dddddd;
}
</style>
</head>
<body>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
<p>A background color is added to the links to show the link area.</p>
<p>Notice that the whole link area is clickable, not just the text.</p>
</body>
</html>
ΔΗΜΙΟΥΡΓΩ ΈΝΑ ΓΚΡΙΖΟ
ΜΠΛΟΚ ΠΙΣΩ ΑΠΌ ΤΑ ΣΤΟΙΧΕΙΑ
ΤΗΣ ΛΙΣΤΑΣ-ΥΠΕΡΣΥΝΔΕΣΜΟΥΣ
• You can also set the width of <ul>, and remove
the width of <a>, as they will take up the full
width available when displayed as block
elements. This will produce the same result as
our previous example:
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 60px;
}
li a {
display: block;
background-color: #dddddd;
}
</style>
</head>
<body>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
<p>A background color is added to the links to show the link area.</p>
<p>Notice that the whole link area is clickable, not just the text.</p>
</body>
• Create a basic vertical navigation bar with a
gray background color and change the
background color of the links when the user
moves the mouse over them:
• ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
}
li a {
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
}
li a {
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
}
/* Change the link color on hover */
li a:hover {
background-color: #555;
color: white;
}
</style>
</head>
<body>
<h2>Vertical Navigation Bar</h2>
ΌΤΑΝ ΤΟ ΠΟΝΤΙΚΙ
ΠΑΕΙ ΠΑΝΩ ΣΤΟΝ
ΣΥΝΔΕΕΣΜΟ
ΑΛΛΑΖΕΙ ΧΡΩΜΑ
Active/Current Navigation Link
Add an "active" class to the current link to let the user know which page
he/she is on:
• https://www.w3schools.com/css/css_navbar.a
sp
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
}
li a {
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
}
li a.active {
background-color: #4CAF50;
color: white;
}
li a:hover:not(.active) {
background-color: #555;
color: white;
}
</style>
</head>
DEIXNEI POY ΕΙΜΑΣΤΕ
SE MEGETHYNSH
<ul>
<li><a class="active"
href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
ΚΝΤΡΑΡΙΣΜΑ ΣΥΝΔΕΣΜΩΝ ΚΑΙ
ΠΡΟΣΘΕΣΗ Borders
ΠΡΟΣΘΕΤΟΥΜΕ ΤΟ text-align:center ΣΤΟ <li> Ή ΣΤΟ <a> ΓΙΑ ΝΑ
ΚΕΝΤΡΑΡΟΥΜΕ ΤΟΥΣ ΣΥΝΔΕΣΜΟΥΣ
ΠΡΟΣΘΕΤΟΥΜΕ ΤΗΝ ΙΔΙΟΤΗΤΑ border ΣΤΟ <ul>
• ul {
border: 1px solid #555;
}
li {
text-align: center;
border-bottom: 1px solid #555;
}
li:last-child {
border-bottom: none;
}
center the links
border around the navbar
border-bottom to all <li>
elements, except for the last one:
Full-height Fixed Vertical Navbar
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
border: 1px solid #555;
}
li a {
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
}
li {
text-align: center;
border-bottom: 1px solid #555;
}
li:last-child {
border-bottom: none;
}
li a.active {
<body>
<h2>Vertical Navigation Bar</h2>
<p>In this example, we center the navigation
links and add a border to the navigation
bar.</p>
<ul>
<li><a class="active"
href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
21-2-GPE
Css 2c (2) (1) (1) (2)
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 0;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 25%;
background-color: #f1f1f1;
position: fixed;
height: 100%;
overflow: auto;
}
li a {
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
}
li a.active {
background-color: #4CAF50;
color: white;
}
li a:hover:not(.active) {
background-color: #555;
color: white;
}
</style>
</head>
<body>
<ul>
<li><a class="active"
href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
<div style="margin-left:25%;padding:1px
16px;height:1000px;">
<h2>Fixed Full-height Side Nav</h2>
<h3>Try to scroll this area, and see how the
sidenav sticks to the page</h3>
<p>Notice that this div element has a left
margin of 25%. This is because the side
navigation is set to 25% width. If you remove
the margin, the sidenav will overlay/sit on top
of this div.</p>
<p>Also notice that we have set
overflow:auto to sidenav. This will add a
scrollbar when the sidenav is too long (for
example if it has over 50 links inside of it).</p>
<p>Some text..</p>
Inline List Items
• One way to build a horizontal navigation bar
is to specify the <li> elements as inline, in
addition to the "standard" code above:
li {
display: inline;
}
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
}
li {
display:inline;
}
</style>
</head>
<body>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
• Another way of creating a horizontal navigation bar is
to float the <li> elements, and specify a layout for the
navigation links:
li {
float: left;
}
a {
display: block;
padding: 8px;
background-color: #dddddd;
}
•padding: 8px; - Since block elements take up the full width available,
they cannot float next to each other.
•Therefore, specify some padding to make them look good
•float: left; - use float to get
block elements to slide next to each
other
display: block; - Displaying the
links as block elements makes the
whole link area clickable (not just t
text), and it allows us to specify
padding (and height, width, margin
etc. if you want
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
}
li {
float: left;
}
li a {
display: block;
padding: 8px;
background-color: #dddddd;
}
</style>
</head>
<body>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
Css 2c (2) (1) (1) (2)
</style>
</head>
<body>
<ul>
<li><a class="active"
href="#home">Home</a></li>
<li><a
href="#news">News</a></li>
<li><a
href="#contact">Contact</a></li
>
<li><a
href="#about">About</a></li>
</ul>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
/* Change the link color to #111 (black) on
hover */
li a:hover {
Active/Current Navigation Link
• https://www.w3schools.com/css/css_navbar.a
sp
.active {
background-color: #4CAF50;
}
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #111;
}
.active {
background-color: #4CAF50;
}
</style>
</head>
<body>
<ul>
<li><a class="active"
href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
Right-Align Links
• Right-align links by floating the list items to
the right (float:right;):
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #111;
}
.active {
background-color: #4CAF50;
}
</style>
</head>
<body>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li style="float:right"><a class="active"
href="#about">About</a></li>
</ul>
</body>
</html>
Border Dividers
• Add the border-right property to <li> to create
link dividers:
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
border-right:1px solid #bbb;
}
li:last-child {
border-right: none;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #111;
}
.active {
background-color: #4CAF50;
}
</style>
</head>
<body>
<ul>
<li><a class="active"
href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li style="float:right"><a
href="#about">About</a></li>
</ul>
</body>
</html>
Gray Horizontal Navbar
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
border: 1px solid #e7e7e7;
background-color: #f3f3f3;
}
li {
float: left;
}
li a {
display: block;
color: #666;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #ddd;
}
li a.active {
color: white;
background-color: #4CAF50;
}
</style>
</head>
<body>
<ul>
<li><a class="active"
href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
Βγαζω το
border-right
Δεν υπαρχει
li:last-child
Dropdowns
<!DOCTYPE html>
<html>
<head>
<style>
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
padding: 12px 16px;
z-index: 1;
}
.dropdown:hover .dropdown-content {
display: block;
}
</style>
</head>
<body>
<h2>Hoverable Dropdown</h2>
<p>Move the mouse over the text below to
open the dropdown content.</p>
<div class="dropdown">
<span style="color:blue">Mouse over
me</span>
<div class="dropdown-content">
<p>Hello World!</p>
</div>
</div>
</body>
</html>
used to color a part of a text
<!DOCTYPE html>
<html>
<head>
<style>
.dropbtn {
background-color: #4CAF50;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px
rgba(0,0,0,0.2);
z-index: 1;
}
<body>
<h2>Dropdown Menu</h2>
<p>Move the mouse over the
button to open the dropdown
menu.</p>
<div class="dropdown">
<button
class="dropbtn">Dropdown</b
utton>
<div class="dropdown-
content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div>
<p><strong>Note:</strong> We
use href="#" for test links. In a
real web site this would be
URLs.</p>
</body>
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover
{background-color: #f1f1f1}
.dropdown:hover
.dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-color:
#3e8e41;
}
</style>
</head>
<!DOCTYPE html>
<html>
<head>
<style>
.button {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
</style>
</head>
<body>
<h2>CSS Buttons</h2>
<button>Default Button</button>
<a href="#" class="button">Link Button</a>
<button class="button">Button</button>
<input type="button" class="button"
value="Input Button">
</body>
</html>
<head>
<SCRIPT>
function passWord() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1.toLowerCase() == "letmein") {
alert('You Got it Right!');
window.open('https://gtutor2.weebly.com/user0.htm
l');
break;
}
testV+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please
Try Again.','Password');
}
if (pass1.toLowerCase()!="password" & testV ==3)
history.go(-1);
return " ";
}
</SCRIPT>
<body>
<h2>CSS Buttons</h2>
<CENTER>
<FORM>
</FORM>
</CENTER>
<style>
.button {
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
</style>
</head>
<!DOCTYPE html>
<html>
<head>
<style>
.button {
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.button2 {background-color: #008CBA;} /* Blue */
</style>
</head>
<body>
<button class="button">Green</button>
<button class="button button2">Blue</button>
</body>
</html>
Button Sizes
https://www.w3schools.com/css/css3_
buttons.asp

More Related Content

PDF
HTML5 & CSS3 Flag
PDF
Doing it in style - creating beautiful sites, the web standards way / WebDD /...
PDF
HTML5 Semantics
DOCX
Fansihttp://www.ricepullers.in/FANSI
PDF
Layout with CSS
TXT
http://kariwebsite.com/
PPSX
Introduction to Html5
PDF
HTML5 Essentials
HTML5 & CSS3 Flag
Doing it in style - creating beautiful sites, the web standards way / WebDD /...
HTML5 Semantics
Fansihttp://www.ricepullers.in/FANSI
Layout with CSS
http://kariwebsite.com/
Introduction to Html5
HTML5 Essentials

What's hot (20)

PPTX
Introduction to HTML5
PDF
CSS Frameworks
RTF
Herritable Bond 1825 Alexander Mackenzie.Txt.Xhtml
PDF
HTML5 and the web of tomorrow!
PDF
UI Design with HTML5 & CSS3
KEY
Slow kinda sucks
PDF
Modular HTML, CSS, & JS Workshop
PDF
Html bangla
PDF
Styling with CSS
PDF
Bangla html
PPT
HTML & CSS Workshop Notes
PPT
HTML 5 Complete Reference
PDF
An Introduction To HTML5
PPTX
Introduction to HTML5 and CSS3 (revised)
PPTX
Supercharged HTML & CSS
PPTX
Comp 111chp iv vi
DOCX
Print this
PPT
1. introduction to html5
PPTX
Wdf 222chp iii vi
PPT
LEARN HTML IN A DAY
Introduction to HTML5
CSS Frameworks
Herritable Bond 1825 Alexander Mackenzie.Txt.Xhtml
HTML5 and the web of tomorrow!
UI Design with HTML5 & CSS3
Slow kinda sucks
Modular HTML, CSS, & JS Workshop
Html bangla
Styling with CSS
Bangla html
HTML & CSS Workshop Notes
HTML 5 Complete Reference
An Introduction To HTML5
Introduction to HTML5 and CSS3 (revised)
Supercharged HTML & CSS
Comp 111chp iv vi
Print this
1. introduction to html5
Wdf 222chp iii vi
LEARN HTML IN A DAY
Ad

Similar to Css 2c (2) (1) (1) (2) (20)

PDF
LessCSS Presentation @ April 2015 GTALUG Meeting
PPTX
NevigationMenu.pptx complete notes and types
PPTX
Xlrays online web tutorials
PPTX
Html5 elements-Kip Academy
PPTX
BITM3730 9-27.pptx
PDF
An Intro to HTML & CSS
PDF
Web Design Course: CSS lecture 4
PDF
Class 3 create an absolute layout with css abs position (aptana)
PDF
Vertical bar css and html
PDF
HTML & CSS 2017
PPTX
HTML Lesson HTML FormsHTML Formsvv4.pptx
PPTX
Cascading Style Sheets
PDF
One Div To Save Them All: Controlling Drupal Div's and Implementing a Modular...
PPTX
Html advance
PPTX
HTML-Advance.pptx
PPTX
[SUTD GDSC] Intro to HTML and CSS
DOCX
Css(handbook)
PPT
LIS3353 SP12 Week 4
RTF
جيفيرا باي الساحل الشمالي
PPT
LessCSS Presentation @ April 2015 GTALUG Meeting
NevigationMenu.pptx complete notes and types
Xlrays online web tutorials
Html5 elements-Kip Academy
BITM3730 9-27.pptx
An Intro to HTML & CSS
Web Design Course: CSS lecture 4
Class 3 create an absolute layout with css abs position (aptana)
Vertical bar css and html
HTML & CSS 2017
HTML Lesson HTML FormsHTML Formsvv4.pptx
Cascading Style Sheets
One Div To Save Them All: Controlling Drupal Div's and Implementing a Modular...
Html advance
HTML-Advance.pptx
[SUTD GDSC] Intro to HTML and CSS
Css(handbook)
LIS3353 SP12 Week 4
جيفيرا باي الساحل الشمالي
Ad

Recently uploaded (20)

PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Pharma ospi slides which help in ospi learning
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Computing-Curriculum for Schools in Ghana
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Basic Mud Logging Guide for educational purpose
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Sports Quiz easy sports quiz sports quiz
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Pharma ospi slides which help in ospi learning
STATICS OF THE RIGID BODIES Hibbelers.pdf
Anesthesia in Laparoscopic Surgery in India
PPH.pptx obstetrics and gynecology in nursing
Pharmacology of Heart Failure /Pharmacotherapy of CHF
human mycosis Human fungal infections are called human mycosis..pptx
VCE English Exam - Section C Student Revision Booklet
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Computing-Curriculum for Schools in Ghana
Supply Chain Operations Speaking Notes -ICLT Program
Final Presentation General Medicine 03-08-2024.pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Basic Mud Logging Guide for educational purpose
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Sports Quiz easy sports quiz sports quiz

Css 2c (2) (1) (1) (2)

  • 2. <!DOCTYPE html> <html> <head> <style> a { color: red; } </style> </head> <body> <p><b><a href="default.asp" target="_blank">This is a link</a></b></p> </body> </html> προορισμος Λεξη που θα κανουμε κλικ πανω της Ετικετα υπερσυνδεσμου
  • 3. <!DOCTYPE html> <html> <head> <style> /* unvisited link */ a:link { color: red; text-decoration: none; background-color: yellow; } /* mouse over link */ a:hover{ color: hotpink; text-decoration: underline; background-color: lightgreen; } /* selected link */ a:active { color: blue; } </style> </head> <body> <p><b><a href="default.asp" target="_blank">This is a link</a></b></p> Όταν το ποντικι παει πανω στο λινκ Όταν το ποντικι κανει κλικ πανω στο λινκ
  • 4. <!DOCTYPE html> <html> <head> <style> a:link, a:visited { background-color: green; χρώμα πλαισίου όταν δεν πηγαίνει το ποντίκι πάνω του color: white; padding: 34px 25px; Διαστάσεις πλαισίου text-align: center; text-decoration: none; display: inline-block; } a:hover, a:active { background-color: red; χρώμα πλαισίου όταν πηγαίνει το ποντίκι πάνω του } </style> </head> <body> <a href="default.asp" target="_blank">This is a link</a> </body> </html> 14-2-γπ
  • 6. Navigation bar <!DOCTYPE html> <html> <body> <ul> <li><a href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> <p>Note: We use href="#" for test links. In a real web site this would be URLs.</p> </body> </html>
  • 7. let's remove the bullets and the margins and padding from the list: <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; } </style> </head> <body> <p>In this example, we remove the bullets from the list, and its default padding and margin.</p> <ul> <li><a href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> </body> </html> ΒΓΑΖΩ ΤΙΣ ΚΟΥΚΚΙΔΕΣ ΑΠΌ ΤΗΝ ΛΙΣΤΑ
  • 8. Vertical Navigation Bar To build a vertical navigation bar, you can style the <a> elements inside the list, in addition to the code above:
  • 9. <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; } li a { display: block; width: 60px; background-color: #dddddd; } </style> </head> <body> <ul> <li><a href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> <p>A background color is added to the links to show the link area.</p> <p>Notice that the whole link area is clickable, not just the text.</p> </body> </html> ΔΗΜΙΟΥΡΓΩ ΈΝΑ ΓΚΡΙΖΟ ΜΠΛΟΚ ΠΙΣΩ ΑΠΌ ΤΑ ΣΤΟΙΧΕΙΑ ΤΗΣ ΛΙΣΤΑΣ-ΥΠΕΡΣΥΝΔΕΣΜΟΥΣ
  • 10. • You can also set the width of <ul>, and remove the width of <a>, as they will take up the full width available when displayed as block elements. This will produce the same result as our previous example:
  • 11. <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; width: 60px; } li a { display: block; background-color: #dddddd; } </style> </head> <body> <ul> <li><a href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> <p>A background color is added to the links to show the link area.</p> <p>Notice that the whole link area is clickable, not just the text.</p> </body>
  • 12. • Create a basic vertical navigation bar with a gray background color and change the background color of the links when the user moves the mouse over them:
  • 13. • ul { list-style-type: none; margin: 0; padding: 0; width: 200px; background-color: #f1f1f1; } li a { display: block; color: #000; padding: 8px 16px; text-decoration: none;
  • 14. <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; width: 200px; background-color: #f1f1f1; } li a { display: block; color: #000; padding: 8px 16px; text-decoration: none; } /* Change the link color on hover */ li a:hover { background-color: #555; color: white; } </style> </head> <body> <h2>Vertical Navigation Bar</h2> ΌΤΑΝ ΤΟ ΠΟΝΤΙΚΙ ΠΑΕΙ ΠΑΝΩ ΣΤΟΝ ΣΥΝΔΕΕΣΜΟ ΑΛΛΑΖΕΙ ΧΡΩΜΑ
  • 15. Active/Current Navigation Link Add an "active" class to the current link to let the user know which page he/she is on: • https://www.w3schools.com/css/css_navbar.a sp
  • 16. <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; width: 200px; background-color: #f1f1f1; } li a { display: block; color: #000; padding: 8px 16px; text-decoration: none; } li a.active { background-color: #4CAF50; color: white; } li a:hover:not(.active) { background-color: #555; color: white; } </style> </head> DEIXNEI POY ΕΙΜΑΣΤΕ
  • 17. SE MEGETHYNSH <ul> <li><a class="active" href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul>
  • 19. ΠΡΟΣΘΕΤΟΥΜΕ ΤΟ text-align:center ΣΤΟ <li> Ή ΣΤΟ <a> ΓΙΑ ΝΑ ΚΕΝΤΡΑΡΟΥΜΕ ΤΟΥΣ ΣΥΝΔΕΣΜΟΥΣ ΠΡΟΣΘΕΤΟΥΜΕ ΤΗΝ ΙΔΙΟΤΗΤΑ border ΣΤΟ <ul> • ul { border: 1px solid #555; } li { text-align: center; border-bottom: 1px solid #555; } li:last-child { border-bottom: none; } center the links border around the navbar border-bottom to all <li> elements, except for the last one:
  • 21. <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; width: 200px; background-color: #f1f1f1; border: 1px solid #555; } li a { display: block; color: #000; padding: 8px 16px; text-decoration: none; } li { text-align: center; border-bottom: 1px solid #555; } li:last-child { border-bottom: none; } li a.active { <body> <h2>Vertical Navigation Bar</h2> <p>In this example, we center the navigation links and add a border to the navigation bar.</p> <ul> <li><a class="active" href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> </body> </html> 21-2-GPE
  • 23. <!DOCTYPE html> <html> <head> <style> body { margin: 0; } ul { list-style-type: none; margin: 0; padding: 0; width: 25%; background-color: #f1f1f1; position: fixed; height: 100%; overflow: auto; } li a { display: block; color: #000; padding: 8px 16px; text-decoration: none; } li a.active { background-color: #4CAF50; color: white; } li a:hover:not(.active) { background-color: #555; color: white; } </style> </head> <body> <ul> <li><a class="active" href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> <div style="margin-left:25%;padding:1px 16px;height:1000px;"> <h2>Fixed Full-height Side Nav</h2> <h3>Try to scroll this area, and see how the sidenav sticks to the page</h3> <p>Notice that this div element has a left margin of 25%. This is because the side navigation is set to 25% width. If you remove the margin, the sidenav will overlay/sit on top of this div.</p> <p>Also notice that we have set overflow:auto to sidenav. This will add a scrollbar when the sidenav is too long (for example if it has over 50 links inside of it).</p> <p>Some text..</p>
  • 24. Inline List Items • One way to build a horizontal navigation bar is to specify the <li> elements as inline, in addition to the "standard" code above: li { display: inline; }
  • 25. <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; } li { display:inline; } </style> </head> <body> <ul> <li><a href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> </body> </html>
  • 26. • Another way of creating a horizontal navigation bar is to float the <li> elements, and specify a layout for the navigation links: li { float: left; } a { display: block; padding: 8px; background-color: #dddddd; } •padding: 8px; - Since block elements take up the full width available, they cannot float next to each other. •Therefore, specify some padding to make them look good •float: left; - use float to get block elements to slide next to each other display: block; - Displaying the links as block elements makes the whole link area clickable (not just t text), and it allows us to specify padding (and height, width, margin etc. if you want
  • 27. <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; } li { float: left; } li a { display: block; padding: 8px; background-color: #dddddd; } </style> </head> <body> <ul> <li><a href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> </body> </html>
  • 29. </style> </head> <body> <ul> <li><a class="active" href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li > <li><a href="#about">About</a></li> </ul> </body> </html> <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li { float: left; } li a { display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } /* Change the link color to #111 (black) on hover */ li a:hover {
  • 30. Active/Current Navigation Link • https://www.w3schools.com/css/css_navbar.a sp .active { background-color: #4CAF50; }
  • 31. <head> <style> ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li { float: left; } li a { display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover:not(.active) { background-color: #111; } .active { background-color: #4CAF50; } </style> </head> <body> <ul> <li><a class="active" href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> </body> </html>
  • 32. Right-Align Links • Right-align links by floating the list items to the right (float:right;):
  • 33. <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li { float: left; } li a { display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover:not(.active) { background-color: #111; } .active { background-color: #4CAF50; } </style> </head> <body> <ul> <li><a href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li style="float:right"><a class="active" href="#about">About</a></li> </ul> </body> </html>
  • 34. Border Dividers • Add the border-right property to <li> to create link dividers:
  • 35. <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li { float: left; border-right:1px solid #bbb; } li:last-child { border-right: none; } li a { display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover:not(.active) { background-color: #111; } .active { background-color: #4CAF50; } </style> </head> <body> <ul> <li><a class="active" href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li style="float:right"><a href="#about">About</a></li> </ul> </body> </html>
  • 36. Gray Horizontal Navbar <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; border: 1px solid #e7e7e7; background-color: #f3f3f3; } li { float: left; } li a { display: block; color: #666; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover:not(.active) { background-color: #ddd; } li a.active { color: white; background-color: #4CAF50; } </style> </head> <body> <ul> <li><a class="active" href="#home">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> </body> </html> Βγαζω το border-right Δεν υπαρχει li:last-child
  • 37. Dropdowns <!DOCTYPE html> <html> <head> <style> .dropdown { position: relative; display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); padding: 12px 16px; z-index: 1; } .dropdown:hover .dropdown-content { display: block; } </style> </head> <body> <h2>Hoverable Dropdown</h2> <p>Move the mouse over the text below to open the dropdown content.</p> <div class="dropdown"> <span style="color:blue">Mouse over me</span> <div class="dropdown-content"> <p>Hello World!</p> </div> </div> </body> </html> used to color a part of a text
  • 38. <!DOCTYPE html> <html> <head> <style> .dropbtn { background-color: #4CAF50; color: white; padding: 16px; font-size: 16px; border: none; cursor: pointer; } .dropdown { position: relative; display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } <body> <h2>Dropdown Menu</h2> <p>Move the mouse over the button to open the dropdown menu.</p> <div class="dropdown"> <button class="dropbtn">Dropdown</b utton> <div class="dropdown- content"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> </div> <p><strong>Note:</strong> We use href="#" for test links. In a real web site this would be URLs.</p> </body> .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; } .dropdown-content a:hover {background-color: #f1f1f1} .dropdown:hover .dropdown-content { display: block; } .dropdown:hover .dropbtn { background-color: #3e8e41; } </style> </head>
  • 39. <!DOCTYPE html> <html> <head> <style> .button { background-color: #4CAF50; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; } </style> </head> <body> <h2>CSS Buttons</h2> <button>Default Button</button> <a href="#" class="button">Link Button</a> <button class="button">Button</button> <input type="button" class="button" value="Input Button"> </body> </html>
  • 40. <head> <SCRIPT> function passWord() { var testV = 1; var pass1 = prompt('Please Enter Your Password',' '); while (testV < 3) { if (!pass1) history.go(-1); if (pass1.toLowerCase() == "letmein") { alert('You Got it Right!'); window.open('https://gtutor2.weebly.com/user0.htm l'); break; } testV+=1; var pass1 = prompt('Access Denied - Password Incorrect, Please Try Again.','Password'); } if (pass1.toLowerCase()!="password" & testV ==3) history.go(-1); return " "; } </SCRIPT> <body> <h2>CSS Buttons</h2> <CENTER> <FORM> </FORM> </CENTER> <style> .button { background-color: #4CAF50; /* Green */ border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; } </style> </head>
  • 41. <!DOCTYPE html> <html> <head> <style> .button { background-color: #4CAF50; /* Green */ border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; } .button2 {background-color: #008CBA;} /* Blue */ </style> </head> <body> <button class="button">Green</button> <button class="button button2">Blue</button> </body> </html>