File tree 4 files changed +29
-15
lines changed
introduction/page_structure/visual attributes
4 files changed +29
-15
lines changed Original file line number Diff line number Diff line change 1
- < h1 > The heading will be blue because the color is set in the style attribute </ h1 >
1
+ < h1 style =" color: blue; " > The heading will be blue because the color is set in the style attribute </ h1 >
2
2
3
- < p > The attribute hides the element on a page; the element won't be displayed </ p >
3
+ < p hidden > The attribute hides the element on a page; the element won't be displayed </ p >
4
4
5
- < button > The button with the attribute disabled will be blocked</ button >
5
+ < button disabled > The button with the attribute disabled will be blocked</ button >
Original file line number Diff line number Diff line change 1
1
type : edu
2
2
files :
3
- - name : task.py
4
- visible : false
5
- - name : tests/test_task.py
6
- visible : false
7
- - name : __init__.py
8
- visible : false
9
- - name : tests/__init__.py
10
- visible : false
11
- - name : index.html
12
- visible : true
3
+ - name : index.html
4
+ visible : true
5
+ placeholders :
6
+ - offset : 3
7
+ length : 21
8
+ placeholder_text : " "
9
+ is_visible : false
10
+ - offset : 108
11
+ length : 7
12
+ placeholder_text : " "
13
+ is_visible : false
14
+ - offset : 204
15
+ length : 9
16
+ placeholder_text : " "
17
+ is_visible : false
18
+ - name : task.py
19
+ visible : false
20
+ - name : tests/test_task.py
21
+ visible : false
22
+ - name : __init__.py
23
+ visible : false
24
+ - name : tests/__init__.py
25
+ visible : false
Original file line number Diff line number Diff line change @@ -7,12 +7,13 @@ may be necessary for element locating in tests.
7
7
8
8
Here are examples of attributes that affect rendering and the element's behavior:
9
9
10
- ```
10
+ ``` html
11
11
<h1 style =" color : blue ;" > The heading will be blue because the color is set in the style attribute </h1 >
12
12
13
13
<p hidden > The attribute hidden hides the element on a page; the element won't be displayed </p >
14
14
15
15
<button disabled > The button with the attribute disabled will be blocked </button >
16
16
```
17
17
18
+ ### Task
18
19
Try opening ` index.html ` in your browser. Now add the visual attributes and try opening this file again.
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def test_add(self):
13
13
try :
14
14
self .assertTrue (soup .h1 ["style" ] == "color: blue;" , f"Should be color: blue style, got { soup .h1 ['style' ]} " )
15
15
self .assertTrue ("hidden" in str (soup .p ), f"Should be hidden paragraph" )
16
- self .assertTrue ("disabled" in str (soup .button ), f"Should be disabled button" )
16
+ self .assertTrue ("disabled" in str (soup .button ). split ( '>' )[ 0 ] , f"Should be disabled button" )
17
17
18
18
except Exception as e :
19
19
self .fail ("wrong page structure" )
You can’t perform that action at this time.
0 commit comments