score:0

html elements (like your select/options input) are positioned using css styling -- typically by assigning a "class" (if you want to style several elements the same way), or by "id" (which must be unique within your html document).

so the simplest way to "position" your select list is by including directives like this in the <style> section of your page:

<style>
    #desplegable {
        left: 10px;
        top: 5px;
    }
</style>

less desirable would be to just include those css directives right on the select element itself, using the d3 style(name, value) function:

svg.append("select")
   .attr("id","desplegable")
   .style("left", "10px")
   .style("top", "5px")
   ... etc ...

generally, trying to pixel position html elements is an exercise in frustration -- for both you and your users with different resolution screens and devices. but if you need to give your element some margins or alignment, there are many css directives that should help you get it looking the way you want.

imo, the easiest way to try out different styling is to use f12 to open the browser's dev console -- when you find the element on the page, use the right-hand list of styles to interactively tweak it...


Related Query

More Query from same tag