Currently I am working on getting lots of html code and its related css, via id or class name. Once I have enough data to work with I am unsure how it would be easiest for any model to learn what css should be generated for each element.

My idea is to make a script to extract all html elements from a given file and then map it onto the css code as a possible good output for the model to learn.

For example : script extracts element h1 with class name "title" and then it maps onto its css code, something simple such as

 text-align: center;
 font-size: 40px;

The catch is that the model should also consider the rest of the elements found on that page, likely given in an array of detected elements and then output an array of css as above for each element. My hope here is that it would learn to style entire pages rather than single elements on their own.

Another issue is what to do with the css code itself, wether to try and make the model choose between pre-set options for each element or let it learn the language and its format from scratch.

I am not sure what model would be best to deal with this kind of input and output. Currently my strongest consideration is LSTM.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.