32
Views
4
Comments
Solved
Como colocar um ID em uma div? - How to put an ID in a div?

Preciso colocar um ID em uma div. Não aceita quando eu coloco apenas ID.. Alguém poderia me ajudar dizendo onde eu coloco ou se estou digitando certo. Grato.

Eu preciso colocar um ID em um div. Não aceita quando coloco apenas o ID.. Alguém poderia me ajudar dizendo onde coloquei ou se estou digitando certo. Grato.

Capturar.PNG
UserImage.jpg
Zagal Studio
Solution

Consegui fazer de uma forma que funciona e é muito simples. segue na imagem como fazer. E muito obrigado pela resposta!

ID - Zagal Studio.PNG
2021-06-02 20-50-04
Márcio Carvalho

Hmm Anyway, that's perfect. However, it's not something you will do in real projects. I recommend you use classes instead of doing that; there's no reason it's not a best practice.

Use classes - "If the idea is defining style in the application/pages CSS, sorry, but forget. Use classes and other things. "

Kind Regards,

Márcio

2021-06-02 20-50-04
Márcio Carvalho

Please, do your questions' description in English; that way, you will get more people to help you.

The id must be put on the name of the element.

Please, read this thread's solution.

https://www.outsystems.com/forums/discussion/31456/ids-on-web-blocks/

"

IDs are automatically given by the platform to the elements, to try to ensure uniqueness (and because the platform needs them and can't relay on names given or not by the developers).

If the idea is defining style in the application/pages CSS, sorry, but forget. Use classes and other things.

If the idea is to pass to JavaScript or other components, give it a name and you will be able to access the ID, from inside OutSystems, as NameOfYourWebBlock.Id.

"

Kind Regards,

Márcio

UserImage.jpg
Zagal Studio
Solution

Consegui fazer de uma forma que funciona e é muito simples. segue na imagem como fazer. E muito obrigado pela resposta!

ID - Zagal Studio.PNG
2021-06-02 20-50-04
Márcio Carvalho

Hmm Anyway, that's perfect. However, it's not something you will do in real projects. I recommend you use classes instead of doing that; there's no reason it's not a best practice.

Use classes - "If the idea is defining style in the application/pages CSS, sorry, but forget. Use classes and other things. "

Kind Regards,

Márcio

UserImage.jpg
Zagal Studio

As classes e Stylos eu já uso de boa.. Mas eu precisava mesmo de algo que substituísse o ID do modo que encontrei.. Grato.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.