# HTML & CSS block

p l e a s e.....p r e t t y p l e a s e?

There is a JS function block....why isn't there a block that enables us to do HTML & CSS? This would make it easier to make miniature webpage projects on Snap!.

Thanks,

F_F101

Hmm. Are you wanting to apply formatting to the Snap! stage? Or make a new window controlled by your HTML? The former would be very, very hard because Snap!'s formatting is done by Morphic, not by the DOM, and so your HTML would be fighting Snap!. As for the latter, can't you make a new window in JS and then inject HTML into it? (I'm not an expert so I could be wrong.)

I want a block that lets us write and format HTML easily on a project...

Try my HTML viewer...

var myHTML = <b>Hello,</b> <em>world!</em><br>
<a href="https://forum.snap.berkeley.edu">Snap<i>!</i> Forum</a>,
myWdw = window.open();
myWdw.document.write(myHTML);


I'm sorry, but I'm still having trouble understanding how that would work. Are you saying you want to put formatted text on the stage?

On the "someday" list is the ability to make a text box that can be positioned on the stage as a sprite. We might implement a subset of HTML, such as for italics and boldface, but it won't be a complete browser!

I think what she means is that she wants to have HTML on the stage with everything like canvas.

Very nice, amirite?

Even Better:

:) except it looks more like the JS function block

Well, as I said, that would be hard to coordinate with Morphic.

@funtime_foxy101 I think we would have to find a different way to solve your underlying problem -- what is it you want to display, and where? Or, if the object of the exercise is to learn more HTML/CSS, so nothing but HTML will do, I think you have to run it in a separate window. You could embed a Snap! instance in that window, so you'd be using both Snap! and HTML, but not in the same space.

HTML with formatting and colors, on a project, but I have to do a lot of work for that to happen. That's the reason for the HTML & CSS block to come in handy, so that way you can make HTML appear on the screen with less blocks.

However, if you meant to ask something else----

A block similar to this

underneath

In the Operators list

Are you talking about the console? If so, I can't use it

No, I meant a whole other browser window or tab, not the one Snap! is running in. But if you want text on the stage that won't do. Can you explain how you'd use it in a project? For example, would something like the Scratch ability to include text in the costume editor satisfy your need?

HTML & CSS block = Help people make little scrollable articles(a web page i guess) of info easier. Unlike the scratch ability to include text into costumes, it allows us to make to add border styles, make all types of fonts, adjust margin size, padding size, and even border color and style.

Unlike the scratch ability to include text into costumes, the block I mentioned about earlier allows us to make to add border styles, make all types of fonts, adjust margin size, padding size, and even border color and style.

In other words, no, not really, although that would be nice to have, it still wouldn't be the same as this block.

OK thank you I get it. Not promising anything soon but I do want something like that.

Okay :)

Welllll, it's blocked :\

And then people don't see why it's so difficult for me to do things these days :\

Anyways, thats the reason why I wanted this block, because not all people have access to other websites(like HTML & CSS code converters), and it's rather difficult to have HTML in a Snap project without doing a lot of work.

Oh ok

Here's a workaround for what you're looking for:

It just creates a new window.

Lemme guess, I have to make a whole new block??

I can't find the call with inputs block

I only can find the call and call w/continuation blocks