Jump to content
Killersites Community
mgreer58

HTML, CSS, Javascript, PHP, etc.

Recommended Posts

I'm a fair way into the HTML 2015 course, and, maybe you will answer the question later on in the course, but, how does the browser know how to implement the different web page design languages, such as HTML 5, CSS, JavaScript, PHP?

I was amazed that you can just type a CSS keyword "style" into an HTML 5 webpage script, and the browser automatically implements it.

I'm old enough to know that I don't have to know all the gory details of how something works, in order to use and enjoy that it does, but, still, the "need to nerd" in me, would like to know.

My guess is that browsers need to be updated for the latest and greatest web design languages as they are created?

-Mike

Share this post


Link to post
Share on other sites

Hi,

For HTML, CSS and JavaScript, the web browsers 'know' what to do because the code has a particular structure that tells the web browser what kind of code it is. For example, with HTML, the tag structure with the angled brackets tell the browser it is HTML. For CSS, it can see CSS with the style attribute or the CSS tag block. With JavaScript, it is the script tag block. 

With PHP, you have to create a PHP page (ex: index.php) ... and when the web server see's the PHP extension, it passes the page to the PHP engine, and it knows how to find and read the PHP code. 

Makes sense?

Stef

  • Like 1

Share this post


Link to post
Share on other sites

In a very general sense, it answers my question.  It's obvious to me how the browser knows how to distinguish the three types of code, my question has more to do with the inner workings of browsers.

Maybe I'm overthinking, unnecessarily, the issue.

It seems to me, that in order for the browser to implement all three separate web page design languages, it has to act as a compiler that can compile three different computer languages.   Well, I guess part of the answer is that it's not a compiler, it's an interpreter.  And, I've actually read of scripting another programming language to perform functions from inside another programming languages code.  For example, scripting Python inside C++ code.

I'm rambling at this point, but, I was just curious about browsers conceptually.  It seems to me, that they must be updated and patched every time another code is developed to program web pages.

-Mike

Share this post


Link to post
Share on other sites
On 2/18/2018 at 1:09 AM, mgreer58 said:

Maybe I'm overthinking, unnecessarily, the issue.

Yep. :)

On 2/18/2018 at 1:09 AM, mgreer58 said:

it's an interpreter. 

Yep again.

There are 'engines' (programs) built into the web browsers that process the code. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×