반응형

[HTML] sns 용 META tag

 

 

반응형
반응형

[HTML] details  summary , jquery로 open 제어

 

<details>

HTML <details> 요소는 "열림" 상태일 때만 내부 정보를 보여주는 정보 공개 위젯을 생성합니다. 요약이나 레이블은 <summary> 요소를 통해 제공할 수 있습니다.

정보 공개 위젯은 보통 레이블 옆의 작은 삼각형이 돌아가면서 열림/닫힘 상태를 나타냅니다. <details> 요소의 첫 번째 자식이 <summary> 요소라면, <summary>의 콘텐츠를 위젯의 레이블로 사용합니다.

 

https://developer.mozilla.org/ko/docs/Web/HTML/Element/details

 

<details> - HTML: Hypertext Markup Language | MDN

HTML <details> 요소는 "열림" 상태일 때만 내부 정보를 보여주는 정보 공개 위젯을 생성합니다. 요약이나 레이블은 <summary> 요소를 통해 제공할 수 있습니다.

developer.mozilla.org

Open 추가

$('details').attr('open','');

 

Opne 제거

$('details').removeAttr('open');

 

$('.info').on('click', 'details', function () {
    $('details').removeAttr('open');
    $(this).attr('open', '');
});

반응형
반응형

입력항목 기록 삭제, How to clear history of text input

https://www.w3schools.com/tags/att_input_autocomplete.asp

 

HTML input autocomplete Attribute

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

<input type="email" name="email" autocomplete="off">


<form action="/action_page.php" autocomplete="on">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname"><br><br>
  <label for="email">Email:</label>
  <input type="email" id="email" name="email" autocomplete="off"><br><br>
  <input type="submit">
</form>

속성 autocomplete은 입력 필드에서 자동 완성을 활성화해야 하는지 여부를 지정합니다.

 

자동 완성을 사용하면 브라우저가 값을 예측할 수 있습니다. 사용자가 필드에 입력하기 시작하면 브라우저는 이전에 입력한 값을 기반으로 필드를 채울 수 있는 옵션을 표시해야 합니다.

 

참고: 속성 autocomplete은 텍스트, 검색, URL, 전화번호, 이메일, 비밀번호, 날짜 선택기, 범위 및 색상 입력 유형과 함께 작동합니다.

반응형
반응형

autofocus

문서가 로드되면 autofocus 속성이 들어간 input 태그에 자동으로 focus가 이뤄집니다.

  <form action="" method="">
    <input type="text" autofocus>
    <input type="text">
    <input type="text">
  </form>

 

required

회원가입을 할 때 필수항목을 입력하지 않으면 경고 문구가 뜨고 넘어가지 않죠? 원래는 스크립트로 구현해야 하는데 HTML로 쉽게 할 수 있는 방법이 바로 required 속성입니다.

input태그 모두 required속성을 주겠습니다.
그리고 한 칸을 비운채로 submit버튼을 누르면 어떻게 될까요?

  <form action="" method="">
    <input type="text" required>
    <input type="text" required>
    <input type="text" required>
    <button type="submit">다음</button>
  </form>

placeholder  

고객이 회원가입을 할 때 해당 입력창에 뭘 입력해야 하는지 힌트를 주는 속성이 바로 placeholder입니다.
물론 응용해서 회원가입 뿐만 아니라 다양한 용도로 사용할 수도 있겠죠?

  <form action="" method="">
    <input type="text" placeholder="아이디">
    <input type="password" placeholder="비밀번호">
  </form>

readonly  

입력은 받지 않고 읽기와 복사만 가능한 속성입니다.
어디에 사용하는지가 제일 중요하죠?

스크립트를 이용해서 특정 조건을 만족하면 활성화가 되게끔 합니다. 예를 들면 은행 대출을 받을 때 사전 설문조사로 특정 조건을 만족한 고객만 해당 입력창에 입력이 가능하도록 하는 것이죠.

  <form action="" method="">
    <input type="text" readonly value="조건 만족 전 입력 불가">
  </form>
반응형
반응형

HTML 특수문자

HTML 상에서 특수문자가 제대로 나타나지 않을 수 있기 때문에 아래 문자들를 사용합니다.
표현문자 숫자표현 문자표현 설명
- &#00;-&#08; - 사용하지 않음
space &#09; - 수평탭
space &#10; - 줄 삽입
- &#11;-&#31; - 사용하지 않음
space &#32; - 여백
! &#33; - 느낌표
" &#34; &quot; 따옴표
# &#35; - 숫자기호
$ &#36; - 달러
% &#37; - 백분율 기호
& &#38; &amp; Ampersand
' &#39; - 작은 따옴표
( &#40; - 왼쪽 괄호
) &#41; - 오른쪽 괄호
* &#42; - 아스트릭
+ &#43; - 더하기 기호
, &#44; - 쉼표
- &#45; - Hyphen
. &#46; - 마침표
/ &#47; - Solidus (slash)
0 - 9 &#48;-&#57; - 0부터 9까지
: &#58; - 콜론
; &#59; - 세미콜론
< &#60; &lt; 보다 작은
= &#61; - 등호
> &#62; &gt; 보다 큰
? &#63; - 물음표
@ &#64; - Commercial at
A - Z &#65;-&#90; - A부터 Z까지
[ &#91; - 왼쪽 대괄호
\ &#92; - 역슬래쉬
] &#93; - 오른쪽 대괄호
^ &#94; - 탈자부호
_ &#95; - 수평선
` &#96; - Acute accent
a - z &#97;-&#122; - a부터 z까지
{ &#123; - 왼쪽 중괄호
| &#124; - 수직선
} &#125; - 오른쪽 중괄호
~ &#126; - 꼬리표
- &#127;-&#159; - 사용하지 않음
  &#160; &nbsp; Non-breaking space
¡ &#161; &iexcl; 거꾸로된 느낌표
&#162; &cent; 센트 기호
&#163; &pound; 파운드
¤ &#164; &curren; 현재 환율
&#165; &yen;
| &#166; &brvbar; 끊어진 수직선
§ &#167; &sect; 섹션 기호
¨ &#168; &uml; 움라우트
&#169; &copy; 저작권
ª &#170; &ordf; Feminine ordinal
&#171; &laquo; 왼쪽 꺾인 괄호
&#172; &not; 부정
­ &#173; &shy; Soft hyphen
? &#174; &reg; 등록상표
&hibar; &#175; &macr; Macron accent
° &#176; &deg; Degree sign
± &#177; &plusmn; Plus or minus
² &#178; &sup2; Superscript two
³ &#179; &sup3; Superscript three
´ &#180; &acute; Acute accent
μ &#181; &micro; Micro sign (Mu)
&#182; &para; 문단기호
· &#183; &middot; Middle dot
¸ &#184; &cedil; Cedilla
¹ &#185; &sup1; Superscript one
º &#186; &ordm; Masculine ordinal
&#187; &raquo; 오른쪽 꺾인 괄호
¼ &#188; &frac14; 4분의 1
½ &#189; &frac12; 2분의 1
¾ &#190; &frac34; 4분의 3
¿ &#191; &iquest; 거꾸로된 물음표
A &#192; &Agrave; Capital A, grave accent
A &#193; &Aacute; Capital A, acute accent
A &#194; &Acirc; Capital A, circumflex accent
A &#195; &Atilde; Capital A, tilde
A &#196; &Auml; Capital A, dieresis or umlaut mark
A &#197; &Aring; Capital A, ring (Angstrom)
Æ &#198; &AElig; Capital AE diphthong (ligature)
C &#199; &Ccedil; Capital C, cedilla
E &#200; &Egrave; Capital E, grave accent
E &#201; &Eacute; Capital E, acute accent
E &#202; &Ecirc; Capital E, circumflex accent
E &#203; &Euml; Capital E, dieresis or umlaut mark
I &#204; &Igrave; Capital I, grave accent
I &#205; &Iacute; Capital I, acute accent
I &#206; &Icirc; Capital I, circumflex accent
I &#207; &Iuml; Capital I, dieresis or umlaut mark
Ð &#208; &ETH; Capital Eth, Icelandic
N &#209; &Ntilde; Capital N, tilde
O &#210; &Ograve; Capital O, grave accent
O &#211; &Oacute; Capital O, acute accent
O &#212; &Ocirc; Capital O, circumflex accent
O &#213; &Otilde; Capital O, tilde
O &#214; &Ouml; Capital O, dieresis or umlaut mark
× &#215; &times; Multiply sign
Ø &#216; &Oslash; width="130"Capital O, slash
U &#217; &Ugrave; Capital U, grave accent
U &#218; &Uacute; Capital U, acute accent
U &#219; &Ucirc; Capital U, circumflex accent
U &#220; &Uuml; Capital U, dieresis or umlaut mark
Y &#221; &Yacute; Capital Y, acute accent
Þ &#222; &THORN; Capital Thorn, Icelandic
ß &#223; &szlig; Small sharp s, German (sz ligature)
a &#224; &agrave; Small a, grave accent
a &#225; &aacute; Small a, acute accent
a &#226; &acirc; Small a, circumflex accent
a &#227; &atilde; Small a, tilde
a &#228; &auml; Small a, dieresis or umlaut mark
a &#229; &aring; Small a, ring
æ &#230; &aelig; Small ae diphthong (ligature)
c &#231; &ccedil; Small c, cedilla
e &#232; &egrave; Small e, grave accent
e &#233; &eacute; Small e, acute accent
e &#234; &ecirc; Small e, circumflex accent
e &#235; &euml; Small e, dieresis or umlaut mark
i &#236; &igrave; Small i, grave accent
i &#237; &iacute; Small i, acute accent
i &#238; &icirc; Small i, circumflex accent
i &#239; &iuml; Small i, dieresis or umlaut mark
ð &#240; &eth; Small eth, Icelandic
n &#241; &ntilde; Small n, tilde
o &#242; &ograve; Small o, grave accent
o &#243; &oacute; Small o, acute accent
o &#244; &ocirc; Small o, circumflex accent
o &#245; &otilde; Small o, tilde
o &#246; &ouml; Small o, dieresis or umlaut mark
÷ &#247; &divide; Division sign
ø &#248; &oslash; Small o, slash
u &#249; &ugrave; Small u, grave accent
u &#250; &uacute; Small u, acute accent
u &#251; &ucirc; Small u, circumflex accent
u &#252; &uuml; Small u, dieresis or umlaut mark
y &#253; &yacute; Small y, acute accent
þ &#254; &thorn; Small thorn, Icelandic
y &#255; &yuml; Small y, dieresis or umlaut mark
반응형
반응형

PyScript -  Run Python in Your HTML

 

https://pyscript.net/

 

Pyscript.net

Run Python code in your HTML.

pyscript.net

Examples: https://pyscript.net/examples

PyScript

What is PyScript

Summary

PyScript is a Pythonic alternative to Scratch, JSFiddle, and other "easy to use" programming frameworks, with the goal of making the web a friendly, hackable place where anyone can author interesting and interactive applications.

To get started see the getting started tutorial.

For examples see the pyscript folder.

Longer Version

PyScript is a meta project that aims to combine multiple open technologies into a framework that allows users to create sophisticated browser applications with Python. It integrates seamlessly with the way the DOM works in the browser and allows users to add Python logic in a way that feels natural both to web and Python developers.

Try PyScript

To try PyScript, import the appropriate pyscript files to your html page with:

<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>

You can then use PyScript components in your html page. PyScript currently implements the following elements:

  • <py-script>: can be used to define python code that is executable within the web page. The element itself is not rendered to the page and is only used to add logic
  • <py-repl>: creates a REPL component that is rendered to the page as a code editor and allows users to write executable code

Check out the pyscriptjs/examples folder for more examples on how to use it, all you need to do is open them in Chrome.

How to Contribute

Read the contributing guide to learn about our development process, reporting bugs and improvements, creating issues and asking questions.

Resources

https://github.com/pyscript/pyscript

 

GitHub - pyscript/pyscript: Home Page: https://pyscript.net Examples: https://pyscript.net/examples

Home Page: https://pyscript.net Examples: https://pyscript.net/examples - GitHub - pyscript/pyscript: Home Page: https://pyscript.net Examples: https://pyscript.net/examples

github.com

Anaconda Engineering Blog

 

Anaconda Engineering Blog

Sat 30 April 2022 By Fabio Pliger - pandas One of the main reasons I joined Anaconda seven and a half years ago was the company’s commitment to the data science and Python communities by creating tools that enable people to do more with less. Today I'm h

engineering.anaconda.com

 

반응형
반응형

[python] How to write to an HTML file in Python

https://www.kite.com/python/answers/how-to-write-to-an-html-file-in-python

 

Kite - Free AI Coding Assistant and Code Auto-Complete Plugin

Code faster with Kite’s AI-powered autocomplete plugin for over 16 programming languages and 16 IDEs, featuring Multi-Line Completions. Works 100% locally.

www.kite.com

USE open() AND file.write() TO WRITE TO AN HTML FILE

Use open(file, mode) with mode as "w" to create a new HTML file file or write to an existing one. Use file.write(data) to write data to the file. Use file.close() to close the file after writing.

text = '''
<html>
    <body>
        <h1>Heading</h1>
    </body>
</html>
'''
file = open("sample.html","w")
file.write(text)
file.close()
SAMPLE.HTML
<html>
    <body>
        <h1>Heading</h1>
    </body>
</html>
반응형
반응형

How TO - Sort a Table

 

html 테이블 정렬

 

.

반응형

+ Recent posts