Web page: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Mobile edit Mobile web edit
m Reverted edit by Shouryarajput100 (talk) to last version by Apparition11
 
(25 intermediate revisions by 19 users not shown)
Line 1:
{{short description|Content provided by a website}}
{{Use dmy dates|date=March 2024}}
[[File:PlatypusDead articleZone onCampaign Vector 2022(2658313491).png|thumb|Each article on theThe [[Wikipedia]] website is a distinct webhome page. The [[URL]] is visible in the browser'sof [[address barNASA]] atfrom the top.2008]]
 
A '''web page''' (or '''webpage''') is a [[World Wide Web|Web]] document that is accessed in a [[web browser]].<ref name=":0">{{cite web |title=Web page – definition of web page by The Free Dictionary |url=https://www.thefreedictionary.com/web+page |access-date=23 April 2021 |archive-date=23 April 2021 |archive-url=https://web.archive.org/web/20210423170632/https://www.thefreedictionary.com/web+page |url-status=live }}</ref> A [[website]] typically consists of many web pages [[hyperlink|linked]] together under a common [[___domain name]]. The term "web page" is therefore a [[metaphor]] of paper pages bound together into a book.
def print_board(board):
for row in board:
print(" | ".join(row))
print("-" * 9)
 
def check_winner(board, player):
for row in board:
if all(cell == player for cell in row):
return True
 
for col in range(3):
if all(board[row][col] == player for row in range(3)):
return True
 
if all(board[i][i] == player for i in range(3)) or all(board[i][2-i] == player for i in range(3)):
return True
 
return False
 
def is_full(board):
return all(all(cell != " " for cell in row) for row in board)
 
def tic_tac_toe():
board = [[" " for _ in range(3)] for _ in range(3)]
players = ["X", "O"]
turn = 0
 
while True:
print_board(board)
player = players[turn % 2]
print(f"Player {player}, enter your move (row and column from 0-2, separated by space):")
try:
row, col = map(int, input().split())
if board[row][col] != " ":
print("Cell already taken! Try again.")
continue
except (ValueError, IndexError):
print("Invalid input! Enter row and column numbers (0-2).")
continue
board[row][col] = player
if check_winner(board, player):
print_board(board)
print(f"Player {player} wins!")
break
if is_full(board):
print_board(board)
print("It's a tie!")
break
turn += 1
 
tic_tac_toe()
 
== Navigation ==
{{main|Web navigation}}
[[File:Platypus article on Vector 2022.png|thumb|Each article on the [[Wikipedia]] website is a distinct web page. The [[URL]] is visible in the browser's [[address bar]] at the top.]]
Each web page is identified by a distinct [[URL|Uniform Resource Locator]] (URL). When the user inputs a URL into their [[web browser]], the browser retrieves the necessary content from a [[web server]] and then [[browser engine|transforms]] it into an interactive visual representation on the user's screen.<ref>{{cite web|url=http://taligarsiel.com/Projects/howbrowserswork1.htm|title=Behind the scenes of modern web browsers|publisher=Tali Garsiel|access-date=2018-04-21|archive-date=2018-04-18|archive-url=https://web.archive.org/web/20180418175529/http://taligarsiel.com/Projects/howbrowserswork1.htm|url-status=live}}</ref>
 
Line 68 ⟶ 13:
 
==Elements==
A web page is a [[structured document]]. The core element is a [[text file]] written in the [[HTML|HyperText Markup Language]] (HTML). This specifies the content of the page,<ref name="elems">{{Cite book|last=Flanagan|first=David|url=https://www.worldcat.org/oclc/686709345|title=JavaScript: the definitive guide|date=18 April 2011|publisher=O'Reilly|isbn=978-1-4493-9385-4|___location=Beijing; Farnham|page=1|language=English|oclc=686709345|quote=JavaScript is part of the triad of technologies that all Web developers must learn: HTML to specify the content of web pages, CSS to specify the presentation of web pages, and JavaScript to specify the behavior of web pages.}}</ref> including [[image]]s and [[video]].
[[File:Dead Zone Campaign (2658313491).png|thumb|The [[home page]] of [[NASA]] from 2008]]
 
A web page is a [[structured document]]. The core element is a [[text file]] written in the [[HTML|HyperText Markup Language]] (HTML). This specifies the content of the page,<ref name="elems">{{Cite book|last=Flanagan|first=David|url=https://www.worldcat.org/oclc/686709345|title=JavaScript: the definitive guide|date=18 April 2011|publisher=O'Reilly|isbn=978-1-4493-9385-4|___location=Beijing; Farnham|page=1|language=English|oclc=686709345|quote=JavaScript is part of the triad of technologies that all Web developers must learn: HTML to specify the content of web pages, CSS to specify the presentation of web pages, and JavaScript to specify the behavior of web pages.}}</ref> including [[image]]s and [[video]].
 
[[CSS|Cascading Style Sheets]] (CSS) specify the [[Separation of content and presentation|presentation]] of the page.<ref name="elems"/> CSS rules can be in separate text files or embedded within the HTML file.