File tree Expand file tree Collapse file tree 3 files changed +95
-0
lines changed
36. Read More and Read Less Expand file tree Collapse file tree 3 files changed +95
-0
lines changed Original file line number Diff line number Diff line change 1+ const containerTwo = document . querySelector ( ".content-container-2" ) ;
2+ const btn = document . querySelector ( ".btn" ) ;
3+
4+ btn . addEventListener ( "click" , ( ) => {
5+ containerTwo . classList . toggle ( "toggle" ) ;
6+ } ) ;
Original file line number Diff line number Diff line change 1+ < html lang ="en ">
2+ < head >
3+ < meta charset ="UTF-8 " />
4+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6+ < title > Read More / Read Less</ title >
7+ < link rel ="stylesheet " href ="style.css " />
8+ </ head >
9+ < body >
10+ < div class ="container ">
11+ < header >
12+ < h2 > Welcome To The Real World</ h2 >
13+ < p class ="para ">
14+ < span class ="content-container-1 ">
15+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam quia
16+ vitae ipsam incidunt ipsa sapiente. Repellat labore odit, cum
17+ blanditiis eum sed delectus, ipsa debitis eius quibusdam aliquam
18+ harum officia ...
19+ </ span >
20+ < br />
21+ </ p >
22+
23+ < p class ="para ">
24+ < span class ="content-container-2 ">
25+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam quia
26+ vitae ipsam incidunt ipsa sapiente. Repellat labore odit, cum
27+ blanditiis eum sed delectus, ipsa debitis eius quibusdam aliquam
28+ harum officia ...
29+ </ span >
30+ < button class ="btn "> Learn More</ button >
31+ </ p >
32+ </ header >
33+ </ div >
34+
35+ < script src ="app.js "> </ script >
36+ </ body >
37+ </ html >
Original file line number Diff line number Diff line change 1+ * {
2+ margin : 0 ;
3+ padding : 0 ;
4+ box-sizing : border-box;
5+ font-family : sans-serif;
6+ }
7+
8+ body {
9+ min-height : 100vh ;
10+ background-color : blanchedalmond;
11+ display : flex;
12+ justify-content : center;
13+ align-items : center;
14+ padding : 70px ;
15+ }
16+
17+ .container {
18+ background : # fff ;
19+ padding : 30px 40px ;
20+ border-radius : 10px ;
21+ width : 50% ;
22+ }
23+
24+ header h2 {
25+ font-size : 1.4rem ;
26+ }
27+
28+ .para {
29+ margin-top : 12px ;
30+ font-size : 18px ;
31+ }
32+
33+ .para .content-container-2 {
34+ display : none;
35+ }
36+
37+ .btn {
38+ background-color : black;
39+ color : # fff ;
40+ padding : 10px 45px ;
41+ font-size : 1.1rem ;
42+ border-radius : 5px ;
43+ outline : none;
44+ border : none;
45+ cursor : pointer;
46+ margin-top : 15px ;
47+ }
48+
49+ /* JavaScript */
50+ .content-container-2 .toggle {
51+ display : block;
52+ }
You can’t perform that action at this time.
0 commit comments