Created
September 5, 2016 18:52
-
-
Save abhisharma2/48c27f5037adee22450688a37354a599 to your computer and use it in GitHub Desktop.
text-editor-html-css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
height: 100vh; | |
width: 100%; | |
} | |
.editor-container { | |
width: 20vw; | |
} | |
.options { | |
list-style-type: none; | |
padding-left: 0; | |
width: 100%; | |
} | |
.option { | |
display: inline-block; | |
width: 23%; | |
text-align: center; | |
} | |
.option button { | |
border: 1px solid #eee; | |
border-radius: 4px; | |
background: white; | |
} | |
.option button:hover { | |
cursor: pointer; | |
} | |
.fa { | |
font-size: 1.5em !important; | |
} | |
.editor { | |
border: 1px solid #eee; | |
width: 100%; | |
height: 200px; | |
padding: 1em; | |
font-size: 1em; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en" class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="editor.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> | |
<title>Simple Rich Text Editor Demo</title> | |
</head> | |
<body> | |
<div class="editor-container"> | |
<ul class="options"> | |
<li class="option"><button id="bold"><i class="fa fa-bold"></i></button></li> | |
<li class="option"><button id="italicize"><i class="fa fa-italic"></i></button></li> | |
<li class="option"><button id="underline"><i class="fa fa-underline"></i></button></li> | |
<li class="option"><button id="clear">Clear</button></li> | |
</ul> | |
<textarea id="editor" class="editor" placeholder="Type something..."></textarea> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment